Search code examples
psexec

How can you bring a background process to the foreground (make it possible to select the GUI)


I have written a small script to access a remote machine then run an executable however the executable runs only in the background.

Is it possible to run so I am able to see the gui?

psexec IPADDRESS -u USERNAME -p PASSWORD -i SESSIONID -d "C:\Windows\system32\notepad.exe"

Solution

  • Thanks for your help Avshalom.

    The answer for me was to change my sessionid from 0 to 2.