Jump to content

Can someone help me fix this? "command line exe"


Recommended Posts

Im trying to make a compiled exe from a script with the ability to run command line switches...

From what I understand from the help file and examples on this forum, Ive made the script, but its not working like it needs to.

Ive obviuosly misunderstood something from what ive read in the help file, and other examples ive looked through on this forum.

Could someone please help me fix this, or explain to me what Im doing wrong.

The complied exe will be called modechange.exe, the command lines Im trying are "modechange.exe /game" or "modechange.exe /ent" and "modechange.exe /aud"

Here is my script... so what am I doing wrong? Forgive me if Im being stupid, but I obviously just dont understand it very well.

If CmdLine["game"] Then funcgame
ElseIf CmdLine["ent"] Then funcent
ElseIf CmdLine["aud"] Then funcaud
EndIf
Exit
func (funcgame)
Local $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AZMSu.exe", "")
Local $var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MdSwtchu.exe","")
Run ($var1)
Run ($var2)
WinActivate ("Mode Switcher")
WinWaitActive("Mode Switcher")
ControlClick ("[CLASS:CTModeSwitcherClass]", "", 24003, "primary", 2, "", "")
EndFunc
Exit
func (funcent)
Local $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AZMSu.exe", "")
Local $var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MdSwtchu.exe","")
Run ($var1)
Run ($var2)
WinActivate ("Mode Switcher")
WinWaitActive("Mode Switcher")
ControlClick ("[CLASS:CTModeSwitcherClass]", "", 24001, "primary", 2, "", "")
EndFunc
Exit
func (funcaud)
Local $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AZMSu.exe", "")
Local $var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MdSwtchu.exe","")
Run ($var1)
Run ($var2)
WinActivate ("Mode Switcher")
WinWaitActive("Mode Switcher")
ControlClick ("[CLASS:CTModeSwitcherClass]", "", 24002, "primary", 2, "", "")
EndFunc
Exit
Link to comment
Share on other sites

Ok thanks for the help... let me see if I can apply that.

As for accessing the help file, trust me im doing that, I wouldnt have come up with the rest of the script if I wasnt reading the help file.

My problem isnt "not reading"... my problem is "not understanding"...

Link to comment
Share on other sites

Ahhh... lol... its your signature that I mistook at a hint to go READ =P

But I think ive got it now... I used the example by "water" on another thread

If $CmdLine[0] = 0 Then Exit MsgBox(16, $sTitle, "No parameters passed!")
If $CmdLine[1] = "/?" Then ConsoleWrite("Help follows here ..." & @CRLF)
If $CmdLine[1] = "/dir" Then RunWait("test2.exe /dir C:temp*.exe")

Seems to be working like a charm for me ^^

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...