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!

Recommended Today

Choose react or angular 2

Original addressChoosing between React vs. Angular 2The following is the translation of this article, which can be used at your choiceReactperhapsAngular2We need to help when we need to. React has become a cool representative in 2015, but angular.js has changed from a front-end framework that people love to a terrible devil (and not so terrible…) […]