Windows batch changing file names [on hold]
-4
I use the following to change file names from %20 to _ but i really need it to be a whitespace. What do i need to change?
@echo off
setlocal EnableDelayedExpansion
:: remove variables starting $
For %%b IN ($) DO FOR /F "delims==" %%a In ('set %%b 2^>Nul') DO SET "%%a="
FOR %%a IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
FOR %%b IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
SET "$%%a%%b=%%%%a%%b"
)
)
for /f "delims=" %%I in ('dir /b /a-d^| find "%%"') do (
SET "var1=%%I"
FOR /f "tokens=2delims==" %%x IN ('set $') DO SET "var1=!var1:%%x=_"!"
IF "%%I" neq "!var1!" REN "%%I" "!var1!"
)
GOTO :EOF
bash shell-script
New contributor
put on hold as off-topic by Jeff Schaller, thrig, steeldriver, Sparhawk, mosvy 1 hour ago
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
-4
I use the following to change file names from %20 to _ but i really need it to be a whitespace. What do i need to change?
@echo off
setlocal EnableDelayedExpansion
:: remove variables starting $
For %%b IN ($) DO FOR /F "delims==" %%a In ('set %%b 2^>Nul') DO SET "%%a="
FOR %%a IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
FOR %%b IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
SET "$%%a%%b=%%%%a%%b"
)
)
for /f "delims=" %%I in ('dir /b /a-d^| find "%%"') do (
SET "var1=%%I"
FOR /f "tokens=2delims==" %%x IN ('set $') DO SET "var1=!var1:%%x=_"!"
IF "%%I" neq "!var1!" REN "%%I" "!var1!"
)
GOTO :EOF
bash shell-script
New contributor
put on hold as off-topic by Jeff Schaller, thrig, steeldriver, Sparhawk, mosvy 1 hour ago
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
6
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago
add a comment |
-4
-4
-4
I use the following to change file names from %20 to _ but i really need it to be a whitespace. What do i need to change?
@echo off
setlocal EnableDelayedExpansion
:: remove variables starting $
For %%b IN ($) DO FOR /F "delims==" %%a In ('set %%b 2^>Nul') DO SET "%%a="
FOR %%a IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
FOR %%b IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
SET "$%%a%%b=%%%%a%%b"
)
)
for /f "delims=" %%I in ('dir /b /a-d^| find "%%"') do (
SET "var1=%%I"
FOR /f "tokens=2delims==" %%x IN ('set $') DO SET "var1=!var1:%%x=_"!"
IF "%%I" neq "!var1!" REN "%%I" "!var1!"
)
GOTO :EOF
bash shell-script
New contributor
I use the following to change file names from %20 to _ but i really need it to be a whitespace. What do i need to change?
@echo off
setlocal EnableDelayedExpansion
:: remove variables starting $
For %%b IN ($) DO FOR /F "delims==" %%a In ('set %%b 2^>Nul') DO SET "%%a="
FOR %%a IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
FOR %%b IN (0 1 2 3 4 5 6 7 8 9 a b c d e f) DO (
SET "$%%a%%b=%%%%a%%b"
)
)
for /f "delims=" %%I in ('dir /b /a-d^| find "%%"') do (
SET "var1=%%I"
FOR /f "tokens=2delims==" %%x IN ('set $') DO SET "var1=!var1:%%x=_"!"
IF "%%I" neq "!var1!" REN "%%I" "!var1!"
)
GOTO :EOF
bash shell-script
bash shell-script
New contributor
New contributor
edited 12 mins ago
Rui F Ribeiro
39.6k1479132
39.6k1479132
New contributor
asked 3 hours ago
John TaylorJohn Taylor
1
1
New contributor
New contributor
put on hold as off-topic by Jeff Schaller, thrig, steeldriver, Sparhawk, mosvy 1 hour ago
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by Jeff Schaller, thrig, steeldriver, Sparhawk, mosvy 1 hour ago
- This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.
6
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago
add a comment |
6
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago
6
6
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
6
I'm voting to close this question as off-topic because this is a Windows/DOS batch script. Try superuser?
– Jeff Schaller
3 hours ago
Consider also a more meaningful title...
– Jeff Schaller
3 hours ago