Guest Guidosoft Posted February 27, 2005 Posted February 27, 2005 (edited) Example of script taking it upon itself to execute a batch file without showing it, and showing echos in a msgbox.;Batch File embedded into script. ;Author: Guido Arbia ;DATA STRUCTURE "BATCH FILE" ;ECHO THIS IS TEXT >> C:\Windows\Desktop\Spmething.txt ;REN C:\Windows\Desktop\Something.txt Florp.txt ;ECHO THIS IS A GUTTER MOUTH CONVENTION >> C:\Windows\Desktop\Florp.txt ;MOVE C:\Windows\Desktop\Florp.txt C:\Wip.ini ;ECHO HELLO WORLD FROM MORON TOWN!!! ;END DATA STRUCTURE #include "ScriptInternalData.AU3" $BatData = ExtractDataStructure("BATCH FILE") If @Compiled then msgBox(0,"WTF", "This script only works open-source. OK!!!!") Exit EndIf For $I = 1 to $BatData[0] If StringLeft($BatData[$I],4) <> "ECHO" then Run(@Comspec & " /C " & $BatData[$I],"",@SW_HIDE) Else If not StringInStr($BatData[$I], ">>") then $BatData[$I] = StringReplace($BatData[$I],"ECHO.","ECHO") $BatData[$I] = StringReplace($BatData[$I],"ECHO ","ECHO ") MsgBox(0,"BATCH FILE",StringTrimLeft($BatData[$I],5)) Else Run(@Comspec & " /C " & $BatData[$I],"",@SW_HIDE) EndIf EndIf Next ;END OF FILEScriptInternalData.AU3 can be found at:http://www.AutoItScript.com/fileman/users/public/Guidosoft Edited February 27, 2005 by Guidosoft
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