MarkVR Posted April 14, 2008 Share Posted April 14, 2008 After I have compiled my exe I will be running it in a command window. What I want to achieve is almost the same as the now.exe if you know it. c:\>now.exe Hello Will return the date and time plus the "Hello". ie (09:30 - 14/04/08 Hello) in the command window. So I want my script/exe to look at the command line I type to run it and then set the argument "Hello" or what ever to a variable so that the exe will be able to use it. Thanks in advance Link to comment Share on other sites More sharing options...
DarkMatter Posted April 14, 2008 Share Posted April 14, 2008 This will cover it as long as you have only one parameter: If $CmdLine[0] > 0 Then $Var = $CmdLine[1] EndIf [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
henry1 Posted April 14, 2008 Share Posted April 14, 2008 Hi MarkVR, c:\>now.exe Hello Will return the date and time plus the "Hello". ie (09:30 - 14/04/08 Hello) in the command window. Try this: If $CmdLine[0] > 0 Then $var = $CmdLine[1] ConsoleWrite(@HOUR & ":" & @MIN & " - " & @MDAY & "/" & @MON & "/" & StringRight(@YEAR, 2) & " " & $var) Exit EndIf Henry Link to comment Share on other sites More sharing options...
MarkVR Posted April 14, 2008 Author Share Posted April 14, 2008 (edited) This will cover it as long as you have only one parameter: If $CmdLine[0] > 0 Then $Var = $CmdLine[1] EndIf Thank you And thx Henry Edited April 14, 2008 by MarkVR Link to comment Share on other sites More sharing options...
MarkVR Posted April 14, 2008 Author Share Posted April 14, 2008 Ahh ok the consolewrite does not seem to work. This is how I did it thanks again for the input: If $CmdLine[0] > 0 Then $argument = $CmdLine[1] EndIf $Date = _DateTimeFormat( _NowCalc(),2) $Time = @HOUR&":"&@MIN $Output = $Date& " - "& $Time run(@ComSpec &" /k echo " &$Output &" - " & $argument) Link to comment Share on other sites More sharing options...
henry1 Posted April 14, 2008 Share Posted April 14, 2008 (edited) Try to add this on the beginning: #AutoIt3Wrapper_Change2CUI=y Edit: Also, what do you mean "does not seem to work"? Can you explain the issue? Is there an error generate when you perform compile? Edited April 14, 2008 by henry1 Henry 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