CopyFile using - long file names

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
BlackWisdom
Pro Scripter
Posts: 58
Joined: Thu Oct 16, 2003 12:53 am

CopyFile using - long file names

Post by BlackWisdom » Sun Dec 18, 2005 8:19 pm

Hey Guys look at this code:



Let>filename=MergeSessionIncomplete
Let>newfilename=MergeSessionIncomplete.exe

CopyFile>filename,newfilename

I think Mach Sched does not like the format of my long filenames, when I run the above code the file generated look like this:

MergeSes

any ideas how to get around this...??? :o

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Dec 18, 2005 8:58 pm

Hi,

There is no length limit. That works perfectly for me. Here's my script:


Let>path=C:\Documents and Settings\Marcus\My Documents\
Let>filename=%path%MergeSessionIncomplete
Let>newfilename=%path%MergeSessionIncomplete.exe
CopyFile>filename,newfilename


I made a small file called MergeSessionIncomplete and after running the script there exists MergeSessionIncomplete.exe

No issues. Which version of Macro Scheduler are you using and which version of Windows are you running?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

BlackWisdom
Pro Scripter
Posts: 58
Joined: Thu Oct 16, 2003 12:53 am

hi mtettmar...

Post by BlackWisdom » Mon Dec 19, 2005 4:53 am

thanks for the quick reply im running MSChed 7.3.11.4 with win 2k

but I noticed you did it slightly different from me - The program Im developing must allow the command to run from the root of the folder without any path given because I dont know where the user will install the app. But I got around it by using this code:


Let>filename=MergeSessionIncomplete
Let>newfilename=MergeSessionIncomplete.exe

CopyFile>filename,newfilename
MoveFile>MergeSes, MergeSessionIncomplete.exe

its somewhat sloppy, but it works... :wink:

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Dec 19, 2005 2:26 pm

Did some testing and found that BlackWisdom seems to be correct, the path added to the front of the file names causes CopyFile to function correctly when copying files in the current working directory. Additionally, if you add anything to the front of the destination file name CopyFile works correctly.

Try this, it works correctly:

Let>filename=MergeSessionIncomplete
Let>newfilename=AddMergeSessionIncomplete.exe

CopyFile>filename,newfilename

BlackWisdom,
I would recommend that you make a small change to your program and make the CopyFile destination name something completely different from "MergeSessionIncomplete". You are currently relying on the failure of the CopyFile program. If this turns out to be a Macro Scheduler problem and is fixed, the MoveFile operation will cause a failure notice on any WinNT 4.0 machine since the file "MergeSe" will not have been created.

Hope this is helpful,
Dick
Last edited by JRL on Mon Dec 19, 2005 2:56 pm, edited 1 time in total.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Re: hi mtettmar...

Post by support » Mon Dec 19, 2005 2:33 pm

BlackWisdom wrote:but I noticed you did it slightly different from me - The program Im developing must allow the command to run from the root of the folder without any path given because I dont know where the user will install the app. But I got around it by using this code:
I don't see how this would work on the root though. This simply works on the current directory since you have specified no drive or path. It will not necessarily work at the root level unless that is the current directory.
MJT Net Support
[email protected]

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