MoveFile Issue

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Alex Silva

MoveFile Issue

Post by Alex Silva » Tue Apr 15, 2003 7:18 pm

I am having a problem with the MoveFile> command.

The problem is that if the file that I am trying to rename is already a long-file-name, which they always will be, the macro works 1 out of every 2. Take a longfilenameaverylongnamesolongitsridiculous.tif for example, and run the macro and it will rename it to longfile.tif the good-old 8.3 from DOS. Anyone knows if this is a problem with the MoveFile> command? if it is limited to 8.3 to rename? If I give it a 8.3 file it will always work.

My output files will be Section 1 - 1 Sided - Cover.tif
The files are originally called Scanjob_20030415_152529.tif


This is what my macro looks like, not exactly, but this is the part where it renames.

Input>file,Find File to Rename
Input>sect,Enter Section Number (Enter #)
Input>side,Enter Single Sided or Double (Enter #)
MoveFile>%file%,Section %sect% - %side% Sided - Cover.tif


I know that if I run the macro twice, then I have NO PROBLEMS. But, that's not what I want to do.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Apr 15, 2003 9:26 pm

Just a thought:

I don't see any reference to the file paths for source and destination.

You may also need to do IfFileExists> after doing Input>, before doing MoveFile> to make no typo was made. Suppose the filename has been Inputted wrong and it doesn't exist? When MoveFile> runs you get no warning or indication of an error. All looks good to the user.

You may also want to do IfFileExists> after the move on the Destination File to verify Move worked OK.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Thu Apr 17, 2003 9:27 am

Run Program>cmd /c move c:\mydirectory\blablabla.tif c:\otherdirectory\longfilenameaverylongnamesolongitsridiculous.tif

cmd = WinNT/W2K/XP
command = 9x/ME

Check the move command: cmd /k move /?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Apr 17, 2003 3:42 pm

I think you may need to add double quotes for long filenames, especially if there might be spaces?
Like this:

Run Program>cmd /c move "c:\my directory\blablabla.tif" "c:\otherdirectory\longfilename averylongname solongitsridiculous.tif"
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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