I have some folders that are named a specific way:
Administration
LS01....
LS02....
LS03....
I want to create a batch file that is located in that folder. When the batch file is started, it goes through the names of the folders and changes the LS to SW, uses the numbers and removes the excess name.
I have no experience with batch-coding, but tried my best. This is what I could come up with until now:
for /D %%f in ("%cd%\*") do (
set "name=%%~nf"
set name=%name:LS=%
rename "%%f" "SW_%name%"
pause.
)
I don't understand why the setting of the variable name does not work. The folders get renamed but only with SW_. The number, which should be in the variable name, does not show up.
Could you please help me out with my code ?
Thank you for your attention.
Best regards
Sam
PS: I'm new to stackoverflow