Execute exe on remote machine

前端 未结 4 681
孤城傲影
孤城傲影 2020-12-07 03:55

I\'m trying to execute notepad.exe on a remote machine, but it\'s not working now. What am I missing?

var ui = new ImpersonateUser();
    //the process to re         


        
4条回答
  •  有刺的猬
    2020-12-07 04:13

    Running an interactive program such as notepad.exe doesn't always open a visible window on the target PC. Try opening Task Manager on the target PC while you run the code and see if notepad.exe appears in the list of running processes.

    I'd suggest trying to run psexec from the command line first before attempting to call it via code.

    psexec \\serverName "notepad.exe"
    

    You may also want to use the "interactive" flag so it can interact with the desktop on the target.

    psexec \\serverName "notepad.exe" -i
    

提交回复
热议问题