Win32_Processnot visible on remote machine
From: NayJo (CrawNOSPAMforMEford_at_mindspring.com)
Date: 01/05/05
- Next message: Chris Davis: "Re: Rebooting a PC while not logged-on"
- Previous message: Michael Sports: "RE: InitiateSystemShutdown error 21"
- Next in thread: NayJo: "Re: Win32_Processnot visible on remote machine"
- Reply: NayJo: "Re: Win32_Processnot visible on remote machine"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 5 Jan 2005 13:51:54 -0500
I am starting a process on a remote machine using the exec.vbs script
included with the Windows 2000 Resource Kit. This script uses WMI to start
a Win32_Process on a remote machine. The process I start waits for an event
then it displays a window and runs a batch file in a separate command
window. Both windows are there to show the progress of the application.
Successful completion of the task results in a system reboot.
If I run this program from Explorer then I do see the windows. But if I
start the program from a remote machine using exec.vbs the program runs
successfully but never displays anything that I can see.
It is almost as if the program is running on another desktop. How do I make
it visible to the user?
I hope that MS does not mind me posting a little code here but I assume this
may be the relevant portion - as I've said the process is created - it is
just not visible.
'---------------------
' From exec.vbs Version 1.0
'* Copyright (C) 1999 Microsoft Corporation
'---------------------
' To connect to WMI...
'Create Locator object to connect to remote CIM object manager
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
If Err.Number then
Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & _
" occurred in creating a locator object." )
If Err.Description <> "" Then
Call Wscript.Echo( "Error description: " & Err.Description &
"." )
End If
Err.Clear
blnConnect = True 'An error occurred
Exit Function
End If
'Connect to the namespace which is either local or remote
Set objService = objLocator.ConnectServer (strServer, strNameSpace, _
strUserName, strPassword)
ObjService.Security_.impersonationlevel = 3
'---------------------
' To create the process... (J)
'---------------------
strMessage = ""
intProcessId = 0
Set objInstance = objService.Get("Win32_Process")
If blnErrorOccurred(" occurred getting a " & _
" Win32_Process class object.") Then Exit Sub
If objInstance is nothing Then Exit Sub
intStatus = objInstance.Create(strCommand, null, null, intProcessId)
If blnErrorOccurred(" occurred in creating process " & _
strCommand & ".") Then Exit Sub
'---------------------
Is it security related or process related? Many thanks in advance.
John C.
- Next message: Chris Davis: "Re: Rebooting a PC while not logged-on"
- Previous message: Michael Sports: "RE: InitiateSystemShutdown error 21"
- Next in thread: NayJo: "Re: Win32_Processnot visible on remote machine"
- Reply: NayJo: "Re: Win32_Processnot visible on remote machine"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|