Hi can anyone tell me why this command does not work
rename "\\Bon2\D\LR Safe-Bon2\*.*" "\\Bon2\D\LR Safe-Bon2\FH - %fstamp%.*"
It gets rejected as the Syntax of the command is incorrect.
The paths shown are correct, and the variable fstamp shows correctly when Echo is used. But in any even it says the Syntax is wrong, not the path.
I've stared at this for ages, but cant see what I'm doing wrong.
Hope someone can help.
rename failure
Moderator: DosItHelp
Re: rename failure
Straight from the help file. Read the last line.
The syntax usage clearly shows that [PATH] is an option for the source file name but not the target file name.
Code: Select all
H:\>rename /?
Renames a file or files.
RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.
Note that you cannot specify a new drive or path for your destination file.
Re: rename failure
It is so simple when someone that knows what they are talking about explains it!
I looked at that for ages, I googled lots of things. And then someone helps.
Thank you very much.
I looked at that for ages, I googled lots of things. And then someone helps.
Thank you very much.
Re: rename failure
Note - You can use MOVE to rename a single file or folder. But you cannot use RENAME or REN to move a file or folder.
REN or RENAME capability
Dave Benham
REN or RENAME capability
- Rename one or more files or folders without moving them
- Move one or more files or folders to a new location, without changing the file or folder name
- Rename exactly one file or folder, without moving it (the command still labels the action as a move)
- Move exactly one file or folder to a new location and rename the file or folder
Dave Benham