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

Running batch file on Remote Desktop login fails

As just extra protection, I am wanting to backup remote sql db to my location nightly. There is no VPN so...

I created a user on the 2008 db server for the sole purpose to log on from my office and download the db bak file nightly. Gave this user read permission on the backup directory (T:\Backup\) and added to the remote users group.

I created a Automated task on my workstation that calls a rdp file that successfully connects to the db server as this user.

The rdp file specifies in the "Start a program" tab the following path:
C:\Windows\System32\mstsc.exe T:\Backup\copydb.bat

I have tested both parts:
1) Double-clicking the rdp file will login automatically.  (WORKS)
2) I can then manualy open the dos prompt and run the bat file. (WORKS)

However, the bat file does not seem to execute on connection . There is no cmd window. I can douple-click on the bat file and the cmd window will flash and go away but does not execute. The only way I've been able to get it to execute is to open the prompt and then the file.

I thought that's what this would do:
C:\Windows\System32\mstsc.exe T:\Backup\copydb.bat

What am I missing?
0
hitman3030
Asked:
hitman3030
1 Solution
 
Sudeep SharmaTechnical DesignerCommented:
The rdp file specifies in the "Start a program" tab the following path:
C:\Windows\System32\mstsc.exe T:\Backup\copydb.bat

The path should only contains the bat file
T:\Backup\copydb.bat

Also did you specified the folder to start in? There are two options on Remote Desktop Connection on Programs tab, try to include the "start folder" as well:
T:\Backup\

rdp start program
0
 
hitman3030Author Commented:
Thanks. That got me to the last hurdle. I also had to add the bat file to RemoteApps in Remote Desktop configuration.
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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