Crash Posted January 1, 2010 Share Posted January 1, 2010 (edited) Hi, let's don't beat about the bush and cut straight to the topic.I have 2 files. One main.exe and one action.exe (both autoit programs)Main.exe will interact with users and sends commands to action.exe and action.exe is supposed to carry out the actions.So like if I want action to do action 1, I will execute it like this:ShellExecute("action.exe", "1")But the problem now is, how do action.exe know the parameter? I mean, how to make it READ the parameter?Pls Please help meIf you're asking me why I want to make them into 2 separate files instead of one. It's simple: because of UAC problems. action.exe will request admin rights and main.exe don't.So anyway, pls please help me!!! Thanks in advance!! Edited January 3, 2010 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 1, 2010 Moderators Share Posted January 1, 2010 Crash,Look in the Help file under <Using AutoIt - Command Line Parameters>. M23P.S. Sorry I can't be more help, but to say that your word "please" is spelled wrongly - twice! Reference Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 1, 2010 Share Posted January 1, 2010 (edited) I have a script (actually it's compiled, but I don't think it makes a difference) that is executed by running a ShellExecute from another script. The calling script passes parameters thru ShellExecute (like you are doing), and the called script processes those as command line arguments. Here is the code I'm using in the called script to do that.If $CmdLine[0] > 1 Then $CountdownToDate1 = $CmdLine[1] $CountdownToDate2 = $CmdLine[2] $AlarmDateTime = $CmdLine[3] ;MsgBox(0, "", $AlarmDateTime & @LF & $CountdownToDate1 & " " & $CountdownToDate2) EndIf Edited January 2, 2010 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
PeterAtkin Posted January 2, 2010 Share Posted January 2, 2010 (edited) This might help you? At the begging of my script after my variable declaration I put this: $cmd = UBound($CmdLine) - 1 If $CmdLine[0] = 0 Then Else ReadCmdLineParams() EndIf The function below then reads the command line parameters and act accordingly. Func ReadCmdLineParams() For $i = 1 To $cmd Select Case $CmdLine[$i] = "-reset" what_ever_you_want() Exit Case $CmdLine[$i] = "-shutdown" what_ever_you_want() Exit Case Else cmdLineHelpMsg() EndSelect Next EndFunc ;==>ReadCmdLineParams This works for me... Edited January 2, 2010 by PeterAtkin [topic='115020'] AD Domain Logon Script[/topic] Link to comment Share on other sites More sharing options...
Crash Posted January 3, 2010 Author Share Posted January 3, 2010 Melba: Oh sorry. It's because 'please' is written as 'pls' in Asia. It's short-cut for your info. By the way, what does the Reference link do? Others: Thank you all very much. But I still need to figure out the scripts first. JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now