Sign in to follow this  
Followers 0
lijun0238

How to stop runwait

3 posts in this topic

tasklist to error how to Continue Script

While 1
dim $var
$var=@YEAR&'_'&@MON&'_'&@MDAY&'_'&@HOUR&'_'&@MIN
DirCreate ('e:\image\'&$var)
 $bn="xp"
For $num = 2 to 219 Step 1
  $name = $bn&"00"&$num
ElseIf $num < 100 Then
$name = $bn&"0"&$num
Else
$name = $bn&$num
EndIf
$ping = Ping($name,0)
If $ping Then
Runwait(@ComSpec & ' /c ' & 'c:\windows\system32\tasklist.exe'&' /s'&' '&$name&' /u administrator /p 123456 > e:\image\'&$var&'\'&$name&'.txt', @ScriptDir, @SW_HIDE)
Else
Runwait(@ComSpec & ' /c ' & 'echo on > e:\image\'&$var&'\'&$name&'.txt', @ScriptDir, @SW_HIDE)
EndIf
$file = FileOpen('e:\image\'&$var&'\'&$name&'.txt', 1)
FileWriteLine($file,"日期="&$var&"  机器名=" & $name & @CRLF & @CRLF)
FileClose($file)
Next
Runwait(@ComSpec & ' /c ' & 'copy e:\image\'&$var&'\*.txt e:\image\'&$var&'.txt', @ScriptDir, @SW_HIDE)
DirRemove('e:\image\'&$var, 1)
Sleep(4000)
WEnd

Share this post


Link to post
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
Sign in to follow this  
Followers 0