sliceofpie 0 Posted September 30, 2010 Hello, I have a script that copies files from one computer to another. I have compiled and would like to run it silently when logged off. I've added a scheduled task to run it but I noticed that my approach will not work. Is there a way to program a switch that I can use to schedule it with? For example: Using "script.exe /silent" will run without any user intervention? Any help is appreciated !!!!! Share this post Link to post Share on other sites
JohnOne 1,603 Posted September 30, 2010 If $CmdLine[0] > 0 Then.... $CmdLine array hold the values of any parameters passed to your script (I think) So you do what you want with them. If its your own creation you can have it run however you want cant you. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
sliceofpie 0 Posted September 30, 2010 Thank you JohnOne! Now I know where to start Share this post Link to post Share on other sites
C45Y 1 Posted October 1, 2010 make sure you run a check on [if $CmdLine[0] > 0 Then....] i was writing an app that takes command line switched not long ago n just glossed over this step... was fun explainging the error messages to colleagues..."umm i got lazy and it was late" just an fyi kinda thing http://twentylinesofcode.blogspot.comLittle apps n crap. can be fun Share this post Link to post Share on other sites
sliceofpie 0 Posted October 1, 2010 What do you mean by: make sure you run a check on [if $CmdLine[0] > 0 Then....] In my example I put: If $CmdLine[0] > 0 Then _run_with_switch() Func _run_with_switch() MsgBox(0, "", "This is running with a command line switch") Exit EndFunc Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 1, 2010 (edited) Nothing wrong with that. $CmdLine[0] will hold the value of the amount of switches passed, [1] - [n] with hold the switches themselves. Edited October 1, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
sliceofpie 0 Posted October 1, 2010 Oh I see. Thanks to both of you'z Share this post Link to post Share on other sites