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









share|improve this question









New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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
















-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









share|improve this question









New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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














-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









share|improve this question









New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 12 mins ago









Rui F Ribeiro

39.6k1479132




39.6k1479132






New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 3 hours ago









John TaylorJohn Taylor

1




1




New contributor




John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






John Taylor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




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














  • 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










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Loup dans la culture

How to solve the problem of ntp “Unable to contact time server” from KDE?

ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux