text: Re: Win32_Processnot visible on remote machine
  From: NayJo (CrawNOSPAMforMEford_at_mindspring.com)
  Date: 01/05/05
  - Previous message: Chris Davis: "Re: Rebooting a PC while not logged-on"
  - In reply to: NayJo: "Win32_Processnot visible on remote machine"
  - Messages sorted by: [ date ] [ thread ]
  Date: Wed, 5 Jan 2005 16:15:42 -0500
  I should have read a little more closely (el rute and Michael Harris).
  If this is turned off, is it available through the straight API?
  NayJo
  "NayJo" <CrawNOSPAMforMEford@mindspring.com> wrote in message
  news:eZcqwe18EHA.1392@tk2msftngp13.phx.gbl...
  > 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)
  > '---------------------
  > 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.
  >
  >
  - Previous message: Chris Davis: "Re: Rebooting a PC while not logged-on"
  - In reply to: NayJo: "Win32_Processnot visible on remote machine"
  - Messages sorted by: [ date ] [ thread ]