Operating registry instance code with vbs

Time:2020-10-17

To turn the CMD on or off:

  Dim WSHShell, r, m, v, t, g
Dim i

On Error Resume Next

Set WSHShell=WScript.CreateObject(“WScript.Shell”)
v=”HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\system\DisableCMD”
i=”REG_DWORD”
T = command prompt window switch “

r=WSHShell.RegRead(v)
g=1

If (r=1) Then g=0
If g=1 Then
 WSHShell.RegWrite v,1,i
M = msgbox (“restrict command prompt window? “,3,t)
Else
 WSHShell.RegDelete v
M = msgbox (“do you want to release the command prompt window? “,3,t)
End If

Copy the above contents into Notepad and save the file as *. VBS!

To open or close the registry:

Dim WSHShell,r,M,v,t,g,i

On Error Resume Next

Set  WSHShell=WScript.CreateObject(“WScript.Shell”)
 v=”HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools”
 i=”REG_DWORD”
T = registry switch
 r=WSHShell.RegRead(v)
 g=1

If r=1 Then g=0
If g=1 Then
 WSHShell.RegWrite v,1,i
M = msgbox (“restrict registry editors?”, 4, t)
Else
 WSHShell.RegDelete v
M = msgbox (“remove registry editor restrictions?”, 4, t)
End If

Also copy the above content to Notepad, save the file as *. VBS!

To open or close Task Manager:

Dim WSHShell, r, m, v, t, g
Dim i

On Error Resume Next

Set WSHShell=WScript.CreateObject(“WScript.Shell”)
v=”HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr”
i=”REG_DWORD”
T = task manager switch

r=WSHShell.RegRead(v)
g=1

If (r=1) Then g=0
If g=1 Then
 WSHShell.RegWrite v,1,i
M = msgbox (“restrict task manager? “,3,t)
Else
 WSHShell.RegDelete v
M = msgbox (“do you want to release task manager? “,3,t)
End If

Also copy the above content to Notepad, save the file as *. VBS!

Hope you can use the above script!