今天和一个高手讨论了一下WMI里WQL查询的时间问题,无果。Google时无意中搜到这段代码,mark一下。
strComputer = "." Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set objVariable = objWMIService._ Get("Win32_Environment").SpawnInstance_ objVariable.Name = "TestValue" objVariable.UserName = "System" objVariable.VariableValue = "This is a test" objVariable.Put_
参考链接:如何使用脚本创建环境变量?