easy1ndian Posted November 27, 2007 Share Posted November 27, 2007 Dears I am using the following batch script to install Windows patches on new machines ----------------------------------------------- @ECHO OFF FOR %%I IN (WindowsXP*.exe) DO ( ECHO %%I START WAIT %%I /quiet /norestart ) ----------------------------------------------- How can i achieve the same result using AutoIT v3 with error logging. I've tried using the help available. I am not a programmer. I would appreciate if someone could help me out thank you Link to comment Share on other sites More sharing options...
weaponx Posted November 27, 2007 Share Posted November 27, 2007 (edited) Not sure, maybe... #include <File.au3> $theArray = _FileListToArray ( @ScriptDir, "WindowsXP*.exe", 1) For $X = 1 to $theArray[0] ConsoleWrite($theArray[$X]) RunWait($theArray[$X] & " /quiet /norestart", @ScriptDir) Next Edited November 27, 2007 by weaponx Link to comment Share on other sites More sharing options...
easy1ndian Posted November 28, 2007 Author Share Posted November 28, 2007 (edited) Thank you very much IT DOES WORK!!! I need a minute modification though. at present the consolewrite(i think) writes the filenames one after another without space. how can I have each file name in new lines and everything written to a text file EDIT: 'new line' got it working using the example from AutoIT help but still need output to text file Edited November 28, 2007 by easy1ndian Link to comment Share on other sites More sharing options...
ame1011 Posted November 28, 2007 Share Posted November 28, 2007 FileWriteLine from the helpfile: $file = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "Line1") FileWriteLine($file, "Line2" & @CRLF) FileWriteLine($file, "Line3") FileClose($file) [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
easy1ndian Posted November 28, 2007 Author Share Posted November 28, 2007 thank you. did it. working 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