start a batch file on remote desktop

Microsoft / Remote desktop
September 30, 2009 at 14:23:33
Specs: Windows XP Pro SP3
I have been searching for ages, but I guess I just don't have the understanding of how networks hang together sufficiently yet.
This is for work and they have decided to not allow scheduler to run on a Remote Desktop which I use. I run a batch file weekly on it to produce various data extracts (in Cognos, but that's another story). So Monday mornings I log into the Remote Desktop and then run a batch file which does all the data extracts.
BUT, I want it to run BEFORE I get into the office.
I have worked out how to open the Remote Desktop with mstsc and an RDP file, complete with password, so I can get to the point where a message box appears on the Remote Desktop reminding me of all the nasty things which will happen to me if I am a naughty boy and this requires that I click OK.
How do I make my batch file click OK in the remote desktop and how do I tell the remote desktop to run the batch file?

See More: start a batch file on remote desktop

Report •

September 30, 2009 at 14:53:32
You would run the batch file the same way you would if you were sitting at that pc.

If you can't do so I would suspect you don't have permissions. You would need to talk to the powers that be so you can have the permissions.

Did they give you a reason why they would not let you schedule the batch? That seems very strange.

Report •

October 1, 2009 at 08:55:46
Hi, thanks but I don't think you quite got what I am saying. If I was sitting at that pc I would double click the batch file.
But I can't do that because I am not in the office when I want it to run. No issue with permissions, I run the batch file manually every week, and can run any reports whenever I like, but no-one is allowed to run the scheduler. The scheduler is disabled.
So how do I start the batch file on the remote pc, but using the scheduler on the local pc?
But don't worry about the schedule bit, how do I make the batch file on the remote pc start from a batch file running on the local pc without user involvement?
I can create rdp file if necessary, but I am not sure if that is part of the answer. I suspect it is not.

Report •

October 1, 2009 at 11:40:14
"but using the scheduler on the local pc?"
No can do.

Closest you can get is to schedule a script on your local pc that automatically starts a rdp session, authenicates, logs on to the distination pc and then manually launches the batch file on that pc.

How you would automate RDP without programming.. I have no idea. Since you would have to provide account/passwords in the script I would see that as a security breach.

Report •

Related Solutions

October 1, 2009 at 12:10:49
Yuck this can be a hard one. What you could do is make a Macro Recording of your keyboard and mouse of you clicking the message. Then setup MS-Scheduler to run the Macro at that machine. You could do the same on your computer through an RDP but the problem is that you can't be sure that the window will open in the exact same place at the same resolution so the mouse click would just click off screen so it would be better to run the macro recording on the remote computer with scheduler.

P.S. are you trying to get around getting to work on time and to login remotely?
If you were trying to do this where I work it would fail because 1) you can not RDP unless you are an administrator and 2) you can not use scheduler.

Report •

October 1, 2009 at 12:38:23
Thanks very much for the answers so far.
I am not trying to login remotely, just want to start the job running before I get there, which will mean I can get on with other things earlier as well.

Wanderer, if I read it right, your second paragraph sounds exactly like what I want to do if 'the script' can launch the remote batch file. How can it be done?

Ace_omega, AutoHotKey looks interesting, I will give that a try and feedback.

Report •

October 1, 2009 at 12:43:39
Just set it up in Microsoft Task Scheduler. Have you ever use it before?

Report •

October 1, 2009 at 14:04:40
Hi ace_omega, yes that is what I already use regularly to run things on local PC. I guess you are suggesting that after I set up the Autohotkey script I run it with the scheduler, yes?

Report •

Ask Question