Jump to content

Recommended Posts

Posted

Apparently I can't see the forest for the trees so maybe someone of you can help me out. I have a little script that among other things opens the cd tray when a drive letter is given as a command-line parameter. "myscript.au3 e" would open drive e. But how do I make the script exit immediately when it is started without any parameter?

If $CmdLine[0] Then 
Exit
Else
do fancy stuff
EndIf
Exit

does still execute "do fancy stuff" instad of stopping immediately. TIA.

MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
Posted

If $CmdLine[0] = 0 Then
 MsgBox(16, "Error", "No commandline parameter given!")
 Exit
EndIf

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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
  • Recently Browsing   0 members

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