例如,设置记事本进程(notepad.exe)的优先级为“高”,vbs 代码: Set objWMIService = GetObject(winmgmts:\\.\root\cimv2) Set colProcesses = objWMIService.ExecQuery(Select * from Win32_process where name='notepad.exe') For Each objProcess In colProcesses objProcess.SetPriority 128 'vbs的这个参数是数字,“低于标准”和“高于标准”不知道怎么设置。 Next
设置优先级为“高于标准”,cmd 命令: wmic process where name='notepad.exe' call SetPriority Above Normal 优先级参数(参数是数字或一个单词可以不加引号): 64 低 32 标准 128 高 256 实时 Idle 低 Below Normal 低于标准 Normal 标准 Above Normal 高于标准 High Priority 高 Realtime 实时 把VBS放到启动项 让开机启动