Simple CopyFile on Windows XP pro just doesn't work...!

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
bmichael
Newbie
Posts: 8
Joined: Wed Dec 28, 2005 1:40 am
Location: Orange County, CA
Contact:

Simple CopyFile on Windows XP pro just doesn't work...!

Post by bmichael » Wed Dec 28, 2005 2:05 am

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.

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

Post by Me_again » Wed Dec 28, 2005 2:41 am

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.

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

Post by Marcus Tettmar » Wed Dec 28, 2005 9:06 am

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?

bmichael
Newbie
Posts: 8
Joined: Wed Dec 28, 2005 1:40 am
Location: Orange County, CA
Contact:

Got it...

Post by bmichael » Wed Dec 28, 2005 5:28 pm

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.

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