MikroMan Posted January 17, 2007 Share Posted January 17, 2007 (edited) I need a new brain. I can't seen to figure out how to repeat my script until I press "No" to a messagebox question. ***** SCRIPT BEGINS ***** $host = InputBox("Hostname","Enter the destination hostname...") $ping = Ping($host,250) If $ping Then; also possible: If @error = 0 Then ... Msgbox(0,"Status", $host & " is online, roundtrip was:" & $ping, 2) Else Msgbox(0,"Status","An error occured with number: " & @error) Exit EndIf FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ess_oam.ini","\\" & $host & "\c$\Program Files\ltbooks\bin\",1) Beep(500,200) FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ESS Switch Documentation.lnk","\\" & $host & "\c$\Documents and settings\All users\Desktop\",1) Beep(500,200) MsgBox(262180,"Complete","Do you want to copy files to another host?",30) ***** SCRIPT ENDS ***** Can any one help? I would be greatful.... Edited January 17, 2007 by MikroMan Link to comment Share on other sites More sharing options...
MHz Posted January 17, 2007 Share Posted January 17, 2007 You can use a loop to call a function repeatedly until no is selected. While 1 PingHost() If MsgBox(262180,"Complete","Do you want to copy files to another host?",30) = 7 Then ExitLoop EndFunc WEnd Func PingHost() $host = InputBox("Hostname","Enter the destination hostname...") $ping = Ping($host,250) If $ping Then; also possible: If @error = 0 Then ... Msgbox(0,"Status", $host & " is online, roundtrip was:" & $ping, 2) Else Msgbox(0,"Status","An error occured with number: " & @error) Exit EndIf FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ess_oam.ini","\\" & $host & "\c$\Program Files\ltbooks\bin\",1) Beep(500,200) FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ESS Switch Documentation.lnk","\\" & $host & "\c$\Documents and settings\All users\Desktop\",1) Beep(500,200) EndFunc Link to comment Share on other sites More sharing options...
MikroMan Posted January 17, 2007 Author Share Posted January 17, 2007 You can use a loop to call a function repeatedly until no is selected. While 1 PingHost() If MsgBox(262180,"Complete","Do you want to copy files to another host?",30) = 7 Then ExitLoop EndFunc WEnd Func PingHost() $host = InputBox("Hostname","Enter the destination hostname...") $ping = Ping($host,250) If $ping Then; also possible: If @error = 0 Then ... Msgbox(0,"Status", $host & " is online, roundtrip was:" & $ping, 2) Else Msgbox(0,"Status","An error occured with number: " & @error) Exit EndIf FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ess_oam.ini","\\" & $host & "\c$\Program Files\ltbooks\bin\",1) Beep(500,200) FileCopy("S:\EUSEASTNC\TEAM JAY\GNVL NOC\DynaText_4_1\5ESS Switch Documentation.lnk","\\" & $host & "\c$\Documents and settings\All users\Desktop\",1) Beep(500,200) EndFunc You ROCK! Super Thanks!!!! 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