Problems with the MoveFile Command??

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
zeke
Newbie
Posts: 11
Joined: Thu Dec 08, 2005 7:23 pm

Problems with the MoveFile Command??

Post by zeke » Tue Nov 06, 2007 12:28 am

Here is my code snippet:

Let>MF_RENAME=1
Let>file1=c:\Temp\*.ltr
Let>file2=c:\Temp\*.doc
MoveFile>%file1%,%file2%

I have several hundred files with the ltr extension in c:\temp. I want to rename them with a doc extension.

It does not seem to work as I thought it might.

If I specifically name a file like c:\temp\abc.ltr then it gets renamed to abc.doc

Am I doing something wrong?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Nov 06, 2007 1:35 am

It does say in the help that wildcards can be used, but windows is very picky about where you can use them in renaming.

This should work for you, note that it is necessary to first change to the working directory:

Change Directory>c:\temp
RunProgram>cmd /c "rename *.ltr *.doc"

Be sure to make a backup before attempting any global change like this.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts