Sign in to follow this  
Followers 0
sliceofpie

Run compiled script with switches

7 posts in this topic

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



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

Thank you JohnOne! Now I know where to start Posted Image

Share this post


Link to post
Share on other sites

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

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

Oh I see. Thanks to both of you'z Posted Image

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0