Setting properties with CopyFile

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Setting properties with CopyFile

Post by Rory » Mon Nov 13, 2006 5:55 pm

Is it possible to set the "Read Only" property of a file when you use the CopyFile function?

Rory

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

Post by Marcus Tettmar » Mon Nov 13, 2006 6:09 pm

No, CopyFile doesn't let you change file attributes. I would just do:

Let>RP_WAIT=1
Run>cmd.exe /c attrib +r %filename%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Post by Rory » Mon Nov 13, 2006 6:27 pm

Do you need to set the "Let>RP_WAIT=1" back to 0 afterwards?


Rory

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

Post by Marcus Tettmar » Mon Nov 13, 2006 6:33 pm

Only if you don't want the script to wait for any subsequent Run Program commands to finish. RP_WAIT=1 makes the script wait for the Run command to complete (rather than just starting the command and continuing). So if you have any subsequent Run commands and you don't want that behaviour for them set RP_WAIT to zero.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Post by Rory » Mon Nov 13, 2006 6:38 pm

Okay, thanks much for the reply

Rory

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