Link to home
Start Free TrialLog in
Avatar of hitman3030
hitman3030

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of Sudeep Sharma
Sudeep Sharma
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hitman3030
hitman3030

ASKER

Thanks. That got me to the last hurdle. I also had to add the bat file to RemoteApps in Remote Desktop configuration.