"Danger" <(E-Mail Removed)> wrote in message
news:4069A1AB-B395-4E74-B411-(E-Mail Removed)...
> This batch file is a simple rename of a file folder
> I can run it on the command line and it works, In a batch file it can not
> find the file name.
>
> the code
> _____________
>
> C:
> cd C:\Documents and Settings\%USERNAME%\Application Data\Research In
> Motion\BlackBerry
> IF Exist intellisync-old (rd /s /q intellisync-old) ELSE (ECHO SUCESS)
> PAUSE
> ren intellisync intellisync-old
> pause
>
> ___________________
>
> the result
>
>
> C:\Documents and Settings\Administrator\Application Data\Research In
> Motion\Blac
> kBerry>IF Exist intellisync-old (rd /s /q intellisync-old ) ELSE (ECHO
> SUCESS )
>
> SUCESS
>
> C:\Documents and Settings\Administrator\Application Data\Research In
> Motion\Blac
> kBerry>PAUSE
> Press any key to continue . . .
>
> C:\Documents and Settings\Administrator\Application Data\Research In
> Motion\Blac
> kBerry>ren intellisync intellisync-old
> The system cannot find the file specified.
>
> C:\Documents and Settings\Administrator\Application Data\Research In
> Motion\Blac
> kBerry>pause
> Press any key to continue . . .
>
> _____________________________________
>
> the file folder with the correct name is in the correct dir
>
> Thank you in advance,
Your batch file tests for the existence of "intellisync.old". It does
not test for the existence of "intellisync", hence the attempt to
rename this folder will fail if the folder does not exist. Nothing
magic there.
About the quotes, missing or otherwise: You ***should***
always surround file/folder names with quotes if they could
contain embedded spaces. There is one exception which
you have found out yourself: The "CD" command does not
require quotes (but it does not object to them either).
|