none
Anwendung starten auf RemotePC RRS feed

  • Frage

  • Hallo @all,

    die Frage habe ich schon im <a href=http://www.ms-office-forum.net/forum/showthread.php?t=274997>ms-office-forum</a> gestellt.

    Bis jetzt habe ich leider keine Antwort darauf bekommen , darum wende ich mich an euch.

     

    Mit folgendem Code (VBScript) starte ich auf einem RemotePC(Windows XP) eine Anwendung:

    <fieldset><legend>Code:</legend>

    Const SW_NORMAL = 1
    strComputer = "192.168.214.241"
    strCommand = "notepad.exe"
    strDomain = ""
    strUser = "USER"
    strPassword = "Password"
    Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")  
    Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
                        "root\CIMV2", _
                        strUser, _
                        strPassword, _
                        "MS_409", _
                        "ntlmdomain:" + strDomain)
       
    ' Configure the Notepad process to show a window
    Set objStartup = objWMIService.Get("Win32_ProcessStartup")  
    Set objConfig = objStartup.SpawnInstance_  
    objConfig.ShowWindow = SW_NORMAL

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


    </fieldset>



    Die Anwendung wird auch gestartet (Taskmanager des RemotePCs zeigt sie unter Prozessen an) ,
    aber unter Anwendungen taucht sie nicht auf , sichtbar ist sie auch nicht.
    Was mache ich falsch?

    mfg Anton

    Mittwoch, 16. Februar 2011 10:10

Antworten

Alle Antworten