Jump to content

For Next Loop and Do Untill


Recommended Posts

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

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 by easy1ndian
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...