Running batch file on Remote Desktop login fails

Posted on 2012-09-17
Medium Priority
Last Modified: 2012-09-17
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?
Question by:hitman3030
LVL 30

Accepted Solution

Sudeep Sharma earned 1200 total points
ID: 38404963
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

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:

rdp start program

Author Comment

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

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question