if (Dnet() = "ON") then ' ON, SO PROMPT TO STOP text = "***Status: ON***" & vbnewline & vbnewline & "Turn OFF Distributed.net? Are you SURE?!?" choice = MsgBox(text, 3+32+256, ScriptName()) if choice = 6 then StopService("Distributed.net Client") outStatus() End If Else ' OFF, SO PROMPT TO START text = "***Status: OFF***" & vbnewline & vbnewline & "Turn ON Distributed.net?" choice = MsgBox(text, 3+16+0, ScriptName()) if choice = 6 then StartService("Distributed.net Client") outStatus() End if End if Sub StopService(ServiceName) Set Sh = CreateObject("WScript.Shell") Sh.Run "cmd /c net stop """ & ServiceName End Sub Sub StartService(ServiceName) Set Sh = CreateObject("WScript.Shell") Sh.Run "cmd /c net start """ & ServiceName End Sub Function Dnet() Dnet = "OFF" set VerService = GetObject ("winmgmts:") For each Process in VerService.InstancesOf ("Win32_Process") If Process.Name = "dnetc.exe" then Dnet = "ON" End If Next End Function Sub outStatus() WScript.Sleep 4000 ' Wait 4 secs MsgBox "***Status: " & Dnet() & "***" & vbnewline & vbnewline & "Script created and customized by:" & vbnewline & "Jacob W. Klein --- kjacob@nova.edu --- 01/01/2005 --- v1.0",,ScriptName() End Sub Function ScriptName() ScriptName = "Distributed.net Service Script" End Function