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...???
CopyFile using - long file names
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 58
- Joined: Thu Oct 16, 2003 12:53 am
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 58
- Joined: Thu Oct 16, 2003 12:53 am
hi mtettmar...
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...
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...
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
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.
Re: hi mtettmar...
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.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:
MJT Net Support
[email protected]
[email protected]