Dim WSHShell, objFSO Set WSHShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Dim counter Set colProcesses = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = " & _ "'winword.exe'") If colProcesses.Count = 0 Then Set objNetwork = WScript.CreateObject("WScript.Network") objNetwork.MapNetworkDrive "N:" , "\\uxdist102\deptspec" WSHShell.Exec("N:\MA\qdesign\perception\Level 0\MA0490\Academic English\presenter.exe") Do While True Set colProcesses2 = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = " & _ "'presenter.exe'") If colProcesses2.Count <> 0 Then WSHShell.Run "taskkill.exe /im winword.exe", 0 WScript.Sleep(1000) Else objNetwork.RemoveNetworkDrive "N:" wscript.quit End If Loop Else msgbox("You cannot run this test with MS Word open. Please SAVE your work and close MS Word before retrying the test.") End If