rename file name with white space server 2003

Microsoft Windows server 2008 standard -...
May 23, 2011 at 05:33:51
Specs: Windows 7
i write -
setlocal enabledelayedexpansion
for %%f in (C:\Inetpub\ftproot\MG_REPORTS\MG_PRO_\Network\Frank\*) do (
set "FN=%%~nxf"
set "FN=!FN: =!"
ren "%%f" "%%~dpf!FN!"
)

and it not rename, throw exception - incorect syntax

See More: rename file name with white space server 2003

Report •


#1
May 23, 2011 at 05:55:28
The second argument must be the name and extension, and nothing else. No drive, and no path information.

How To Ask Questions The Smart Way


Report •

#2
May 23, 2011 at 06:02:53
sorry, can you be more specific? if i run with loop i need to tell where to look for the file isn't?

Report •

#3
May 23, 2011 at 07:34:18
You tell REN where to look for the file, sure, but you can't tell REN where the file will end up, merely what it shall be called.

EDIT:

ren "%%f" "!FN!"

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
May 23, 2011 at 22:48:06
thank you very much! do you know of some good tutorial for batch script?

Report •

Ask Question