Jump to content

command line switch


regisp
 Share

Recommended Posts

hello the world.

i'm trying to find a way to compile a program with command line switch option.

Unfortunately, i'm unable to find a way to do it.

what i want to do :

make a script and compile it.

when running the exe, the script run normally

when running the exe with -debug option, have more info to know what wrong.

hope everything is clear for you guys.

thx a lot for your quick help - dont hesitate to contact me for further explanation if needed.

ciao

Link to comment
Share on other sites

Test this with a /? parameter. It is a template with Scite4AutoIt3 by typing cmdlineselect and pressing the spacebar.

If $Cmdline[0] Then
    For $i = 1 To $Cmdline[0]
        Select
            Case $Cmdline[$i] = '/?'
                MsgBox(262144, StringTrimRight(@ScriptName, 4) & ' Help', _
                        'Switches are:' & @LF _
                         & @LF & '/extract' _
                         & @LF & @TAB & 'Extract files to current directory' _
                         & @LF & '/x' _
                         & @LF & @TAB & '' _
                         & @LF & '/x' _
                         & @LF & @TAB & '' _
                         & @LF & '/x' _
                         & @LF & @TAB & '' _
                         & @LF & '/x' _
                         & @LF & @TAB & '' _
                         & @LF & '/x' _
                         & @LF & @TAB & '')
                Exit
            Case $Cmdline[$i] = '/extract'
                FileInstall('?', @ScriptDir & '\')
                Exit
            Case $Cmdline[$i] = '/x'
            Case $Cmdline[$i] = '/x'
            Case $Cmdline[$i] = '/x'
            Case $Cmdline[$i] = '/x'
            Case $Cmdline[$i] = '/x'
            Case Else
                MsgBox(262144, 'Incorrect switch used', 'Command used:' & @LF & $CmdlineRaw _
                         & @LF & @LF & 'Use /? for the switches available.')
                Exit
        EndSelect
    Next
EndIf
; Replace '/x' with desired switches for the above code. Add/Remove as needed.

Yah, I know, GAFrost is quick. :P

Edit: Missed a letter.

Edited by MHz
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...