How to Enable Remote Assistance in the Registry With WSH
- 1
Open a text editor.laptop image by CraterValley Photo from Fotolia.com
Open a text editor such as Notepad. WSH files are plain text executables, so they can be created using any freely distributed text editor. - 2
You have to create a WMI object.typing image by kuhar from Fotolia.com
Start the code by creating a WMI object. The WMI (Windows Management Instrumentation) is a registry interface object that allows you to query Windows for any setting on the machine. The object is initiated using the following code:
Set wmi = GetObject("winmgmts: {impersonationLevel=impersonate}\\.\root\cimv2") - 3
Query the remote assistance settings to allow remote assistance.computer for work image by lidia_smile from Fotolia.com
Query all the available remote assistance settings. Each setting is changed to allow remote assistance from the network administrator. The code below illustrates how to query the remote assistance settings and assign them to a variable:
Set settings = wmi.ExecQuery ("Select * from Win32_TerminalServiceSetting") - 4
You can now turn on remote assistance in the registry.computer image by Orlando Florin Rosu from Fotolia.com
Turn on remote assistance in the registry. The following code uses the "settings" variable created in Step 3 and changes them to allow the connection:
For each item in settings
errResult = item.SetAllowTSConnections(1)
Next
The "1" value sent to the "SetAllowTSConnections()" function sets it to "true" in the registry.