Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Dec 22 '11 at 23:53

This question came from our site for professional and enthusiast programmers.

You may want to check out Powershell. – user978122 Dec 22 '11 at 18:21
Check out the -i flag. – kichik Dec 22 '11 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 '11 at 18:54
up vote 2 down vote accepted

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.

share|improve this answer
0 is not the console session anymore; it is the services session starting with Vista. – grawity Dec 22 '11 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.

share|improve this answer

You must log in to answer this question.

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