Blynx Posted September 8, 2007 Share Posted September 8, 2007 I can't figure out how to embed a batch file into the script, and have it run when a button is pressed in the GUI. Could someone please help me? Link to comment Share on other sites More sharing options...
maqleod Posted September 8, 2007 Share Posted September 8, 2007 I can't figure out how to embed a batch file into the script, and have it run when a button is pressed in the GUI.Could someone please help me?what do you mean by "embed"?you could try FileInstall() followed by Run() [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
Generator Posted September 8, 2007 Share Posted September 8, 2007 You can just Create a .bat in temp folder and use filewriteline to finish your batch file, finally use run() to execute it. Link to comment Share on other sites More sharing options...
Blynx Posted September 8, 2007 Author Share Posted September 8, 2007 You can just Create a .bat in temp folder and use filewriteline to finish your batch file, finally use run() to execute it.See now there's a problem, the program will REMOVE the temp folder...and could you possibly explain more, I only just started using autoit today. Link to comment Share on other sites More sharing options...
maqleod Posted September 8, 2007 Share Posted September 8, 2007 maybe you could provide more information about what the script and the batch file will do. If we don't have the specifics we cannot provide adequate help [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
MCP Posted October 23, 2007 Share Posted October 23, 2007 I can't figure out how to embed a batch file into the script, and have it run when a button is pressed in the GUI. Could someone please help me?You can use the following skeleton to create a batch file, then you will be able to run it as every other external command. #include <A3LString.au3> Local $sFile = @DesktopDir & '\' & _Str_ExtractFile(@ScriptName) & '.bat' Local $sBAT = '@echo off' & @CRLF & _ '[command1]' & @CRLF & _ '[command2]' & @CRLF & _ '[command3]' & @CRLF & _ '[command4]' & @CRLF Local $file = FileOpen($sFile, 2) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $sBAT) FileClose($file) 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