sda00
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Const LOW = 64 Const BELOW_NORMAL = 16384 Const NORMAL = 32 Const ABOVE_NORMAL = 32768 Const HIGH = 128 set args = WScript.Arguments if args.Count = 0 then WScript.Echo "Usage: CScript Launch.vbs JOB PRIORITY" WScript.Echo "where JOB is the application or batch file including its path" WScript.Echo "and PRIORITY is HIGH | ABOVE_NORMAL | NORMAL| BELOW_NORMAL | LOW" WScript.Echo "" WScript.Echo "Example: Cscript Launch.vbs C:\Windows\Notepad.exe BELOW_NORMAL" WScript.Quit 1 end if strJob = args.Item(0) strPriority = args.Item(1) if strPriority = "LOW" then intPriority = LOW elseif strPriority = "BELOW_NORMAL" then intPriority = BELOW_NORMAL elseif strPriority = "NORMAL" then intPriority = NORMAL elseif strPriority = "ABOVE_NORMAL" then intPriority = ABOVE_NORMAL elseif strPriority = "HIGH" then intPriority = HIGH else intPriority = NORMAL strPriority = "NORMAL" end if strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objStartup = objWMIService.Get("Win32_ProcessStartup") Set objConfig = objStartup.SpawnInstance_ objConfig.PriorityClass = intPriority Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process") objProcess.Create strJob, Null, objConfig, intProcessID Wscript.Echo strJob & " is running with " & strPriority & " priority." | Всего записей: 928 | Зарегистр. 15-02-2004 | Отправлено: 19:45 20-10-2006 | Исправлено: sda00, 19:49 20-10-2006 |
|