Jump to content

simple loop


mgh2468
 Share

Recommended Posts

I know this may be simple to some people. But how do I loop the following until I choose no??

Autoit3 does not have a goto and am not as familiar with the new loop commands.

;Start

$shutdown = InputBox("shutdown", "Enter just the workstation number (ex. 009)",)

$ws = '\\ws' & $shutdown

$Arguments = '-u administrator -p password_HERE -d shutdown -f -m "This computer will shutdown in 30 seconds!" -l 30 -x'

RunWait(@Comspec & " /c " & "beyondexec.exe " & $WS & " " & $Arguments,"")

$answer = MsgBox(4, "Shutdown more", "Shutdown more PC's???")

MsgBox(4096, "AutoIt", "OK. Bye!")

Exit

EndIf

;end

Link to comment
Share on other sites

I know this may be simple to some people. But how do I loop the following until I choose no??

Autoit3 does not have a goto and am not as familiar with the new loop commands.

;Start

$shutdown = InputBox("shutdown", "Enter just the workstation number (ex. 009)",)

$ws = '\\ws' & $shutdown

$Arguments = '-u administrator -p password_HERE -d shutdown -f -m "This computer will shutdown in 30 seconds!" -l 30 -x'

RunWait(@Comspec & " /c " & "beyondexec.exe " & $WS & " " & $Arguments,"")

$answer = MsgBox(4, "Shutdown more", "Shutdown more PC's???")

    MsgBox(4096, "AutoIt", "OK.  Bye!")

    Exit

EndIf

;end

<{POST_SNAPBACK}>

Hello this i sfrom the help.chm.exe i hope thi shelp you out! :lmao:

For $i = 5 to 1 Step -1
    MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")

$i = 0
While $i <= 10
    MsgBox(0, "Value of $i is:", $i)
    $i = $i + 1
WEnd

$i = 0
Do
    MsgBox(0, "Value of $i is:", $i)
    $i = $i + 1
Until $i = 10
Edited by DirtyBanditos
Link to comment
Share on other sites

Do
  ; shutdown code goes here
   $answer = MsgBox(4, "Shutdown more", "Shutdown more PC's???")
Until $answer = 7;return value of 7 equals NO
MsgBox(4096,"AutoIt", "Bye Bye")
Exit

<{POST_SNAPBACK}>

Cool This works great. The ones from the help file only loop until a certian value is reached.

I understand Do... While better now.

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...