Win32_Processnot visible on remote machine

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: NayJo (CrawNOSPAMforMEford_at_mindspring.com)
Date: 01/05/05


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.



Relevant Pages

  • Re: Really slow to get information from Win32_UserAccount
    ... This should get the fullname of current user (local as well as ... WMI provider for the Win32_UserAccount class could avoid having to ... The only way to find out really, is to try my script and see what ... If you mean all the machines that would run the code then no, some of them could be Windows NT 4.0 or Windows 9x.. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: WMI Timeout on Remote Computer
    ... >> I am having problems with running WMI query against a few remote Windows ... the script will go on to the next computer? ... I read that the WMI timeout is set really high ...
    (microsoft.public.scripting.vbscript)
  • RE: MS03-039 Deploy Script
    ... Thanks to Diego for sharing the script with us. ... To run WMI-based scripts, we can install Windows ... Management Instrumentation (WMI) CORE 1.5 on these systems: ... |>>helps deploying the patch using WMI: ...
    (microsoft.public.security)
  • RE: How to start/stop windows service on a remote machine?
    ... impersonate the client user(authenticated via integrated windows ... authentication in IIS) and access some remote protected resource(windows ... the problem you meet is a typical windows ... want to continue access other remote machine, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: What is the difference between WSH, VBScript and WMI (and ADSI) ?
    ... WMI networking methods are only supported on Windows NT-based platforms, ... Network-Related WMI Methods Fail on Windows 95, Windows 98, Windows Me ... Explorer 4.0 or later with WSH and ADSI installed. ... Windows Script Host supports scripts that are written in Visual Basic ...
    (microsoft.public.windowsxp.help_and_support)