Jump to content

Run compiled script with switches


sliceofpie
 Share

Recommended Posts

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...