variable CP_OVERWRITE

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

denissesp
Newbie
Posts: 6
Joined: Wed Mar 17, 2004 11:31 pm

variable CP_OVERWRITE

Post by denissesp » Wed May 12, 2004 6:39 pm

Hi, some one can help me??, i don't know how to use this variable: CF_OVERWRITE, i wanto to copy a file but if it already exists, make a copy each time that i run my macro, in the help says than i need to setting this varibale with 1 but i dont know how, please, helpme.. thanks :?:

Lumumba

Post by Lumumba » Wed May 12, 2004 6:51 pm

Ladies & gentlemen,
correct me if I'm wrong ! Following a standard with MacroScheduler "parameters" is this:

Let>CF_OVERWRITE=1

(there's a nice sample for IfWindowOpen> in its help :wink: )

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 » Wed May 12, 2004 8:19 pm

You stand UNcorrected.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Ringo
Newbie
Posts: 5
Joined: Tue Jul 18, 2006 2:01 pm
Location: Alexandria, VA

CF_Overwrite

Post by Ringo » Thu Aug 17, 2006 4:21 pm

I was experiencing the same problem and added Let>CF_OVERWRITE=1 to my macro, but it still keeps adding a copy of the file rather than writing over it. When I open the macro in editor and view the script details on the right of the split screen, it still appears as CF_OVERWRITE=0.

I am at a loss here and can't seem to get this to simply copy a file over the same file. I am trying to update files on several workstations with new data from a single source workstation.

Please help me if you can.

Thanks!

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

Post by JRL » Thu Aug 17, 2006 6:06 pm

I've used CF_OVERWRITE often and never had a problem. Make sure that the line in your script is exactly as you have posted it and that it appears in the script ahead of the CopyFile> function. The variable needs to be in all capital letters. Also make sure you have not somehow redefined "1". If you have inadvertently set the character "1" equal to zero then setting CF_OVERWRITE=1 would be equvalent to setting CF_OVERWRITE=0.

Hope this is helpful,
Dick

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Thu Aug 17, 2006 6:23 pm

Also make sure the line which contains the Let>CF_OVERWRITE=1 is not skipped in your script.

I say this because I have made this mistake. It always helps if you post the code...you never know what might be found.... :wink:

Ringo
Newbie
Posts: 5
Joined: Tue Jul 18, 2006 2:01 pm
Location: Alexandria, VA

Post by Ringo » Thu Aug 17, 2006 7:10 pm

Thank you very much for your responses. That is working fine for me. If anyone is up for another simple challenge, I would like to copy a file over our network from that workstation to several others. I am not sure how to properly identify the other workstations?? This is how I have it set up now, but it clearly is not correct:

Let>CF_OVERWRITE=1
CopyFile>c:\temp\testdata.xls,\\Ringo\c:\temp\testdata.xls

The " \\Ringo\c: " is my attempt to copy the file from that workstation to a workstation over the network to the c: drive and temp folder of a workstation called "Ringo". I just don't know how to properly identify the destination for my macro over our network??? :oops:

Thanks for taking a look at this!

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Thu Aug 17, 2006 8:46 pm

Hi Ringo,

If you change \\ringo\c:\ to \\ringo\c$\ you should be in business. $ is the standard unc (universal naming convention) syntax for addressing disks over the network.

HTH,
Henk

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

Post by JRL » Thu Aug 17, 2006 10:03 pm

Not to be argumentative, but the workstation to be accessed must be "shared" on the network or there is no UNC addressing scheme that will work. If you have a network administrator, talk to that person about how to make the connection.

Later,
Dick

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

Re: variable CP_OVERWRITE

Post by Me_again » Fri Aug 18, 2006 1:05 am

denissesp wrote:Hi, some one can help me??, i don't know how to use this variable: CF_OVERWRITE,
FWIW a couple of trivial comments:

I think the help is confusing to beginners (at least it confused me when I started :D ) because it generally instructs the user to "set" variables, but doesn't indicate that's the same as Let>CF_OVERWRITE=1

Also would be nice to either alpha sort the system variables listing, or group it logically.

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

Post by Marcus Tettmar » Fri Aug 18, 2006 7:13 am

Things like this are about to become more obvious and easier with version 9.0 ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Fri Aug 18, 2006 7:29 am

Dick, you're absolutely correct. Don't know why, but I assumed that this was already taken care of.

Best,
Henk

Ringo
Newbie
Posts: 5
Joined: Tue Jul 18, 2006 2:01 pm
Location: Alexandria, VA

Post by Ringo » Fri Aug 18, 2006 2:46 pm

Awesome! The $ symbol worked. However, it leads me to a final question...I promise! The file I am trying to copy is a Microsoft Access Application db file. The normal extension is .MDB for that type of file. How should I address that in the script? When I type "mdb" it seems to mistake that for some key stroke instruction.

So, my final questions for this little macro is what extension should I use for this file and/or do I have to use an extension at all?

Thanks

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Fri Aug 18, 2006 3:18 pm

Please post the script, that way we know what we're talking about.

Ringo
Newbie
Posts: 5
Joined: Tue Jul 18, 2006 2:01 pm
Location: Alexandria, VA

Post by Ringo » Fri Aug 18, 2006 3:34 pm

Sure thing:

Let>CF_OVERWRITE=1
CopyFile>c:\program files\tapwatch2\databases\twmain.???,\\Ringo\c$\program files\tapwatch2\databases\twmain.???

Whereas the ???s represent the file extensions for that file. When I type mdb it appears in blue as a command rather than a file extension.

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