Thread Win32::OLE wie jetz? (10 answers)
Opened by oblivion at 2006-02-28 16:11

esskar
 2006-03-02 17:24
#37167 #37167
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Const SW_NORMAL = 1
strComputer = "ams-cl2"
strCommand = "WhatsUp.exe"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}" _
    & "!\\" & strComputer & "\root\cimv2")

Set objStartup = objWMIService.Get("Win32ZZZProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW

' Create Notepad process
Set objProcess = objWMIService.Get("Win32_Process")
intReturn = objProcess.Create _
   (strCommand, Null, objConfig, intProcessID)
If intReturn <> 0 Then
   Wscript.Echo "Process could not be created." & _
       vbNewLine & "Command line: " & strCommand & _
       vbNewLine & "Return value: " & intReturn
Else
   Wscript.Echo "Process created." & _
       vbNewLine & "Command line: " & strCommand & _
       vbNewLine & "Process ID: " & intProcessID
End If


als vb
mit perl geht es genauso\n\n

<!--EDIT|esskar|1141332833-->

View full thread Win32::OLE wie jetz?