sliceofpie Posted September 30, 2010 Share 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 !!!!! Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2010 Share 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. Link to comment Share on other sites More sharing options...
sliceofpie Posted September 30, 2010 Author Share Posted September 30, 2010 Thank you JohnOne! Now I know where to start Link to comment Share on other sites More sharing options...
C45Y Posted October 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
sliceofpie Posted October 1, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
JohnOne Posted October 1, 2010 Share 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. Link to comment Share on other sites More sharing options...
sliceofpie Posted October 1, 2010 Author Share Posted October 1, 2010 Oh I see. Thanks to both of you'z Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now