Starting programs, batch files on computer from a different computer

I have a batch file and a Visual Basic program that, using the Windows Task Scheduler, run around 3am each weekend on a computer in a secured room at work.  If either of these programs fail, for whatever reason, both of them have to be restarted; first the batch file, and when it's finished, then the Visual Basic program. These programs must run on the computer, not anywhere else.  Due to corporate red-tape, I cannot remote in from home to this computer to restart these programs.  However, I can remote onto a server using Terminal Services Client, and the computer and server are linked through the network.  

How can I restart these two programs so that they run on the computer?  Thank you for your help!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

'PsExec' ( can do that:


usage: psexec [\\computer[,computer[,..] | @file ][-u user [-p psswd]][-n s][-s|-e][-i][-c [-f|-v]][-d][-w directory][-<priority>][-a n,n,...] cmd [arguments]

Direct PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.

Directs PsExec to run the command on each computer listed in the text file specified.

Separate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: "-a 2,4"

Copy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.

Don't wait for application to terminate. Only use this option for non-interactive applications.
Loads the specified account's profile.

Copy the specified program to the remote system even if the file already exists on the remote system.

Run the program so that it interacts with the desktop on the remote system.

Specifies timeout in seconds connecting to remote computers.

Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.

Run remote process in the System account .

Specifies optional user name for login to remote computer.

Copy the specified file only if it has a higher version number or is newer on than the one on the remote system.

Set the working directory of the process (relative to the remote computer).

Specifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority.

Name of the program to execute.

Arguments to pass (note that file paths must be absolute paths on the target system)

(see also
If neither of the programs require interaction with the console, you can run them from the command line using TELNET

Start the telnet service and logon with the TELNET.EXE client from you workstation and you have a command prompt that is actually "at" the remote machine.

You will need port 23 open inbound to the server to allow telnet to work.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
psmithphilAuthor Commented:
Well, both ways work to get the batch file going.  For some reason the Visual Basic program, when started via telnet, runs for a little over a minute and then stops.   If I run the program from the Task Scheduler, it runs completely.  I haven't figured out what's going on.  

I'll continue testing and let you know asap.  Again, thank you!
psmithphilAuthor Commented:
For some reason when using either method, the Visual Basic program runs for a little over a minute and then stops.   I even made an AT command through telnet and it still stops.  But when I run it through the Task scheduler it runs okay.  I then changed the rights for the AT command from "system" to my badge.  It then ran, but this program among other things makes zipped exe files, and these are created in the Windows\system32 directory instead of the directory the program runs from.  Therefore, they don't get copied.  I suppose I could make a conditional statement in the program, but I'd like to avoid that.  I also don't know if I'm going to have problems from changing the AT rights in the Task Scheduler.

Both of you have given me great ideas though, and I have learned some things from this experience.  I am going to award you both the points and make a new question later that addresses just this one remaining problem.  Thank you both for your outstanding help!!
psmithphilAuthor Commented:
Just a note to let you know I entered another 500 point question for the remote start problem I'm having.  It's in the Windows 2000 area entitled "Problem starting VB program with telnet & psexec"  Thank you for looking at it!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.