I have done some other scripting tests, but am having difficult with something SUPER basic where copyfile just does not work. Here is the initial test code:
Input>Bridgeuser,Enter the first initial & last name of the user
Let>source1=c:\test\*.*
Let>dest1=c:\test\%Bridgeuser%\*.*
CopyFile>source1,dest1
The debug looks fine, variables created perfectly, no issues. Just doesn't copy.
This also doesn't work:
Let>source1=c:\test\*.*
Let>dest1=c:\test\bmichael\*.*
CopyFile>source1,dest1
Same with this:
Let>source1=c:\test\
Let>dest1=c:\test\bmichael\
CopyFile>source1,dest1
It doesn't get much simpler. What's am I missing?
Thanks -
Bruce.
Simple CopyFile on Windows XP pro just doesn't work...!
Moderators: JRL, Dorian (MJT support)
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I tested this and it seems that a wildcard copy doesn't like the (unnecessary) *.* on the destination. This works for me:
Let>CF_OVERWRITE=1
Let>source1=c:\testa\*.*
Let>dest1=c:\testb\
CopyFile>%source1%,%dest1%
The other thing if you are allowing user input for the directory name is to test that the directory exists and/or create it before the copy.
Let>CF_OVERWRITE=1
Let>source1=c:\testa\*.*
Let>dest1=c:\testb\
CopyFile>%source1%,%dest1%
The other thing if you are allowing user input for the directory name is to test that the directory exists and/or create it before the copy.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Wildcards on the destination are nonsensical.
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?
Got it...
I made the incorrect assumption that a directory would be created if one does not exist. I took your code and added an IfDirExists statement and now it's fine.
As far as the wildcards go, I guess they are redundant. It's force of habit and a little more exact to me when I look at the structure.
Thank you!
Bruce.
As far as the wildcards go, I guess they are redundant. It's force of habit and a little more exact to me when I look at the structure.
Thank you!
Bruce.