ptestfall Posted April 25, 2006 Share Posted April 25, 2006 Hi, the simple thing I want to do is a dos command: echo text > $1 and convert the autoit-file to an exe-file and give the name of the text file as a parameter like e.g. "test.exe textfile.txt". But if I use autoit with Run("cmd /c echo text > $1") and convert it to a exe-file I cannot give a parameter upon execution or it is ignored and the result is a file named $1 with "text" in it. Please help me with this little problem. Thanks pt Link to comment Share on other sites More sharing options...
Don N Posted April 25, 2006 Share Posted April 25, 2006 would an input box work...run the exe and asks for the textfile name or can it just use a default one? lets say text.txt? _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
ptestfall Posted April 25, 2006 Author Share Posted April 25, 2006 An input box is unwanted and a default filename as well. The command for execution should be: test.exe textfile.txt Where test.exe is a compiled autoit script and textfile.txt is just an example. In the end I want to end a complete path like "C:\Program Files\Installation\textfile.txt". Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 25, 2006 Share Posted April 25, 2006 Hi, something like: If $cmdLine[0] = 2 Then ;Run("cmd /c echo " & $cmdLine[1] & ">" & $cmdLine[2]) Run(@ComSpec & " /c " & 'echo '& $cmdLine[1] & ">" & $cmdLine[2], "", @SW_HIDE) Else MsgBox(64, "Error", "Needs two parameters" & @CRLF & @CRLF & _ "1. text" & @CRLF & _ "2. filename.extension") EndIf So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Geert Posted April 25, 2006 Share Posted April 25, 2006 Or If $CmdLine[0] > 0 Then FileWriteLine($CmdLine[1], "text") EndIf Link to comment Share on other sites More sharing options...
ptestfall Posted April 25, 2006 Author Share Posted April 25, 2006 Thanks very much for your great and quick 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