Blynx 0 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? Share this post Link to post Share on other sites
maqleod 1 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 Share this post Link to post Share on other sites
Generator 0 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. Share this post Link to post Share on other sites
Blynx 0 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. Share this post Link to post Share on other sites
maqleod 1 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 Share this post Link to post Share on other sites
MCP 0 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) Share this post Link to post Share on other sites