• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

Terminal Server - Execute a Batch file from within a Terminal Server that executes on local machine

I have a need to be able to log in to a Terminal Server, and run a batch file that runs not within the Terminal Server Session, but from my local computer that I have RDP's from. Once the batch file is started, I would want the Terminal Session to continue  as it was prior to the batch file being run..........is this possible
0
rrudolph
Asked:
rrudolph
  • 3
  • 2
1 Solution
 
suivethfirstCommented:
Yes, log onto the Terminal Server then minimize the session window and run the batch file.

When you maximize the session window again all process continue to run on the local PC.

Is this what you are asking?
0
 
rrudolphAuthor Commented:
Sorry, no that is not what I am asking. I used the batch file example as an easy explanation of what I want to do. The longer version is that I support an application, that needs to run in terminal server mode. I have a couple of program calls that require some action at the local machine level. So I need to be able to call a program from the terminal server session that does not run in the session, but rather goes back to the local host and runs a program.

Thanks,

Rick
0
 
suivethfirstCommented:
Ah, I see. From a batch file perspective this can be achieved by using psexec (http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx)

You would do something like:

psexec \\%clientname% cmd.exe

%clientname% is an environment variable set to the connecting computer name when a user logs onto a terminal server.

This may or may not be what you're looking for - are you trying to achieve this from within the application you're supporting and therefore need some sort of equivalent API call?
0
 
rrudolphAuthor Commented:
suivethfirst,

this is very close to what I need, in my situation, my computer is named D410

Using the psexec\\&clientname%...........the returned characters are \\D410:

the colon is keeping me from running the batch file.........do you have an idea as to how I can "strip" that colon?  If so, I can add the rest of the information.

Thanks,

Rick
0
 
rrudolphAuthor Commented:
Suivethfirst,

Thank you for your ideas. I ran into firewall port issues, but now that I know what they are, I can resolve those.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now