I've written a .bat file to launch an .exe file.

start chrome.exe

I'm invoking that .bat file from a remote machine using psexec (pstools)

psexec -u admin -p pizza1234 "C:\code\myBatFile.bat"

When I invoke the .bat file locally, it launches Chrome into the current user session, and I can see it on the desktop. If I invoke the .bat file remotely (as described above), Chrome launches into a different session, and I can't see it on the (remote) desktop.

Is there a way to force an application to launch into a specific session via the Windows cmd?

  • You may want to check out Powershell.
    – user978122
    Dec 22, 2011 at 18:21
  • Check out the -i flag.
    – kichik
    Dec 22, 2011 at 18:25
  • Thanks for the suggestion guys. I've been running the psexece from Powershell, and I tried the -i flag with no luck. Much appreciate the ideas, though.
    – Hairgami_Master
    Dec 22, 2011 at 18:54

2 Answers 2


You will get a popup like shown below:

enter image description here

You have to click on the View the message to actually see the window, in this case, notepad.

If you want it in a differnt session you have to specify that with the -i flag - -i 1 etc. 0 is the default and is the console session.

  • 0 is not the console session anymore; it is the services session starting with Vista. Dec 22, 2011 at 23:57

I use -i and -d switches.

psexec \\ -u admin -p pizza1234 -i -d chrome.exe

I assume that chrome.exe is in the path of the destination machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .