VBS在隐藏窗口中创建进程

描述

在本地计算机中(但是在隐藏窗口中)启动 Notepad.exe。

脚本代码复制内容到剪贴板代码: Const HIDDEN_WINDOW = 12 strComputer = "." Set objWMIService = GetObject("winmgmts:" _     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objStartup = objWMIService.Get("Win32_ProcessStartup") Set objConfig = objStartup.SpawnInstance_ objConfig.ShowWindow = HIDDEN_WINDOW Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process") errReturn = objProcess.Create("Notepad.exe", null, objConfig, intProcessID)