Edifice Posted February 3, 2009 Posted February 3, 2009 Hello again I just found a heck of a *.bat file, which I would really like to include in my program. All it does is create around a thousand Null-files. Is there some kind of tool that will convert a bat file to Auto-it script? Pleaaaaase say yes!
NerdFencer Posted February 3, 2009 Posted February 3, 2009 uuse the Run() function on the text contents of the bat file _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell
Edifice Posted February 4, 2009 Author Posted February 4, 2009 Well it's basically this line just repeated a lot (with different filenames ofcourse ) type nul > %windir%/winsxs/backup/x86_hid-user.resources_31bf3856ad364e35_6.0.6000.16386_zh-cn_c2f2386dd569373b.manifest Yes I know that I don't need this bat fil per se, but i would really prefer not to have to copy+paste these 1000 or so filenames into Au3
BrettF Posted February 4, 2009 Posted February 4, 2009 Remember you could always parse the .bat file to AutoIt script code... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Edifice Posted February 4, 2009 Author Posted February 4, 2009 Remember you could always parse the .bat file to AutoIt script code... I'm a bit new to Au3 .... How?
Varian Posted February 4, 2009 Posted February 4, 2009 This is just modified code from the AutoIT Helpfile for FileReadLine...just change null.bat to your batfile's path and name Dim $Output $File = FileOpen("null.bat", 0) ; Check if file opened for reading OK If $File = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $Line = FileReadLine($File) If @error = -1 Then ExitLoop If $Line <> '' Then $Output &= 'Run(@Comspec & " /c ' & $Line & '")' & @CRLF WEnd FileClose($File) FileWrite(@ScriptDir & "\NullAutoItScript.au3", $Output) This creates a new file called "NullAutoItScript.au3" that will run the batfile's code in AutoIT. If you are combining text from several batfiles, look up _FileListToArray and For Loops PHAK 1
BrettF Posted February 4, 2009 Posted February 4, 2009 Possible even to convert the whole thing to AutoIt. Varian has the right idea behind it though Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Edifice Posted February 4, 2009 Author Posted February 4, 2009 Hmmm this has some of the generel idea, as to where i am getting at, but not exactly. I guess i'll go about it in another way.
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