批处理更改了 vbs 代码,使其无法被 vbs 使用。我该如何解决?
批号:
echo Const HIGH = 128 >> prio.vbs
echo strComputer = "." >> prio.vbs
echo Set objWMIService = GetObject("winmgmts:" _ >> prio.vbs
echo & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") >> prio.vbs
echo Set colProcesses = objWMIService.ExecQuery _ >> prio.vbs
echo ("Select * from Win32_Process Where Name = 'file.exe'") >> prio.vbs
echo For Each objProcess in colProcesses >> prio.vbs
echo objProcess.SetPriority(HIGH) >> prio.vbs
echo Next >> prio.vbs
VBS 原版:
Const HIGH = 128
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'file.exe'")
For Each objProcess in colProcesses
objProcess.SetPriority(HIGH)
Next
VBS 之后:
Const HIGH = 128
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'file.exe'")
For Each objProcess in colProcesses
objProcess.SetPriority(HIGH)
Next
请帮忙