Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!
ProcessName = "notepad.exe" Set objWMI = GetObject("winmgmts:\\.\root\cimv2") Do Set colItems = objWMI.ExecQuery ("Select * from Win32_Process Where Name = '" & ProcessName & "'") wscript.sleep 1500 Loop While colItems.Count = 0 Set colProcesses = objWMI.ExecNotificationQuery ("Select * From __InstanceDeletionEvent " _ & "Within 1 Where TargetInstance ISA 'Win32_Process' And TargetInstance.Name = '" & ProcessName & "'") Do Set objProcess = colProcesses.NextEvent Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2:Win32_Process") objWMIService.Create ProcessName, null, null, intProcessID msgbox "Started" Loop
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.