Forum Discussion
densaface
13 years agoNew Contributor
Thanks a lot. Your first method is success.
Locator := Sys.OleObject ('WbemScripting.SWbemLocator');
Locator.Security_.Privileges.AddAsString('SeShutdownPrivilege');
WmiService := Locator.ConnectServer (Server, 'root\cimv2', 'Administrator', '1q2w3eQAZ');
NewJob := WmiService.Get('Win32_OperatingSystem.Name="Microsoft Windows Server 2003 Datacenter x64 Edition|C:\\WINDOWS|\\Device\\Harddisk0\\Partition1"');
NewJob.Win32Shutdown('2');
Locator := Sys.OleObject ('WbemScripting.SWbemLocator');
Locator.Security_.Privileges.AddAsString('SeShutdownPrivilege');
WmiService := Locator.ConnectServer (Server, 'root\cimv2', 'Administrator', '1q2w3eQAZ');
NewJob := WmiService.Get('Win32_OperatingSystem.Name="Microsoft Windows Server 2003 Datacenter x64 Edition|C:\\WINDOWS|\\Device\\Harddisk0\\Partition1"');
NewJob.Win32Shutdown('2');
Related Content
- 7 years ago
Recent Discussions
- 24 hours ago