VBS Script to Start the remote registry service

2011/08/31 | By | Reply More

This script will allow you to start the Remote Registry Service on any computer by enering its name or IP

' RemoteRegistryservicestart.vbs
' script to Start Remote Registry on strComputer

Option Explicit
Dim objWMIService, objItem, objService
Dim colListOfServices, strComputer, strService, strInput
strInput = False
' Creates the Input Message Box
Do
strComputer = InputBox("Which Machine? "_
," Remote Machine", strComputer)
If strComputer <> "" Then strInput = True
Loop Until strInput = True
' NB Spelling of RemoteRegistry (No space).
strService = " 'RemoteRegistry' "
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "rootcimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
WSCript.Sleep 1500
objService.StartService()
Next

WScript.Echo "Started " & strService & " on " & strComputer
WScript.Quit

Category: Scripts, VBS

Leave a Reply

%d bloggers like this: