用VBS来代替BAT或CMD文件进行命令第1/2页

2019-01-16 06:43:14刘景俊

!破解下载限制
DIM WSH

SET WSH=WSCRIPT.CreateObject("WSCRIPT.SHELL")
WSH.POPUP("本程序的作用是解决无法下载的问题")
WSH.POPUP("特别是在注册表禁用的情况下破解")
WSH.POPUP("由曾诚制作")
WSH.Regwrite"HKCUSoftwareMicrosoftWindowsCurrentVersionInternet SettingsZones31803",0,"REG_DWORD"
WSH.POPUP("现在您可以下载程序了!") 

!读本机“计算机名”


'ReadComputerName.vbs
Dim ReadComputerName
Set ReadComputerName=WScript.CreateObject("WScript.Shell")
Dim ComputerName,RegPath
RegPath="HKLMSystemCurrentControlSetControlComputerNameComputerNameComputerName"
ComputerName=ReadComputerName.RegRead(RegPath)
MsgBox("计算机名为"&ComputerName)

!隐藏快捷方式图标上的小箭头


'Hidden.vbs
Dim HiddenArrowIcon
Set HiddenArrowIcon=WScript.CreateObject("WScript.Shell")
Dim RegPath1,RegPath2
RegPath1="HKCRlnkfileIsShortCut"
RegPath2="HKCRpiffileIsShortCut"
HiddenArrowIcon.RegDelete(RegPath1)
HiddenArrowIcon.RegDelete(RegPath2)

!改造“开始”菜单


'ChangeStartMenu.vbs
Dim ChangeStartMenu
Set ChangeStartMenu=WScript.CreateObject("WScript.Shell")
RegPath="HKCRSoftwareMicrosoftWindowsCurrentVersionPolicies"
Type_Name="REG_DWORD"
Key_Data=1
  
StartMenu_Run="NoRun"
StartMenu_Find="NoFind"
StartMenu_Close="NoClose"
  
Sub Change(Argument)
ChangeStartMenu.RegWrite RegPath&Argument,Key_Data,Type_Name
MsgBox("Success!")
End Sub
  
Call Change(StartMenu_Run) '禁用“开始”菜单中的“运行”功能
Call Change(StartMenu_Find) '禁用“开始”菜单中的“查找”功能
Call Change(StartMenu_Close) '禁用“开始”菜单中的“关闭系统”功能

!向Windows中添加自启动程序


该程序能在开机时自动运行。
'AddAutoRunProgram.vbs
'假设该程序在c:myfile文件夹中,文件名为autorun.exe
Dim AutoRunProgram
Set AutoRunProgram=WScript.CreateObject("WScript.Shell")
RegPath="HKLMSoftwareMicrosoftWindowsCurrentVersionRun"
Type_Name="REG_SZ"
Key_Name="AutoRun"
Key_Data="C:Myfileautorun.exe"
'该自启动程序的全路径文件名
AutoRunProgram.Write RegPath&Key_Name,Key_Data,Type_Name
'在启动组中添加自启动程序autorun.exe
MsgBox("Success!") 
一、给注册表编辑器解锁

  用记事本编辑如下内容:

DIM WSH
SET WSH=WSCRIPT.CreateObject("WSCRIPT.SHELL") '击活WScript.Shell对象
WSH.POPUP("解锁注册表编辑器!")
'显示弹出信息“解锁注册表编辑器!”
WSH.Regwrite"HKCUSoftwareMicrosoftWindowsCurrentVersion
PoliciesSystemDisableRegistryTools",0,"REG_DWORD"
'给注册表编辑器解锁