How can I create a batch file to run network drives off the terminal server?

Posted on 2008-10-02
Last Modified: 2012-05-05
We are trying to run a program through the TS Remote App on our Server 2008 machine. The program will not allow more than one user to work in it. As a work around I would like to install a batch file onto the Remote Apps that will allow us to use the software locally instead, and connect to the database located on our 2003 Server. How can we make this happen?
Question by:corcent
  • 8
  • 7
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22625820
1:  Create a new share say \\server\program1
2:  Add a login script to your profiles and add a line to call
                   net use <drive> \\server\program1  where <drive> is an unassigned letter (say p:)

Assuming you have setup the correct permissions on the share and drive folder and that it can be ran across a mapped drive (some programs can, others can't) you should be able to launch this via a command call to p:\program.exe

The program should be able to connect to it's own database via p:\program.exe.config assuming it's a dot net application.

Hope this helps.


Author Comment

ID: 22626092
I already have the shares setup on the Terminal Server.

This is the .bat I made and had already installed on the Remote Apps (doesn't work when the user installs it)
net use J: \\\ /persistent:y

net use I: \\\ /persistent:y

What I was hoping to do was to have the users install The Network Drives batch using the TS Remote App while they are in the field so they can connect to our file server. I'm not sure if we are on the same page here.
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22626245
I don't think you need remote apps at this point.  It looks like you're just trying to put this program on the server and let people run it over the network.

I would say do the following mods to your bat.

net use j: /del
net use I: /del

net use J: \\<Server>\<Software>
net use I: \\<Server>\<Documents>


What happens when you try to launch this batch file from remote apps?

LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22626256
Scratch the first comment about not needing remote apps.  I see you're trying to publish the batch file that way which should be fine.

Author Comment

ID: 22626430
I will add that to the script, but i do not understand what J:\program.exe is for at the end of the script.
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22626492
J:\program.exe is to actually kickoff the program remotely.  

Remote apps says publish the batch.

The batch file says delete the mapped drives (to ensure the drive letters)
map the network drives for the program.
Call the program to actually run from the server.  (program.exe is the actual exe used to launch the program, for instance, winword.exe to launch Microsoft Word).


Author Comment

ID: 22626593
Ok that is what i thought but just wanted to make sure. The program is install locally on each user's pc though. The database file that the program links to is J:ImagineTime\tbdata.mdb, so should we put that in the place of J:\program.exe in the script
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22626693
Is this through access?  

The last command can be whatever it needs to be.  Not sure if you can just call the MDB or if you need to pass it as a param (whether it be c:\program files\someprogram.exe -db j:\imaginetime\tbdata.mdb or j:\imaginetime\tbdata.mdb), but the idea behind it is to launch the program.  


Author Comment

ID: 22626782
The DB uses Microsoft Access. We just want to be able to view any files on those shares. Once the link to the server is broken the program will look for the db, so if the script can rewrite the shares and link them through the terminal when they are in the field the program will be able to run normally.

So my overall goal is to be able to access the any info on the shares while the users are in the field.

LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22627080
Yeah, then opening the mdb directly should be fine.

Author Comment

ID: 22627994
We created the batch file and installed it through the terminal and it just brings up the remote desktop login box
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 22628156
does it run locally?  (EG: without remote apps or anything?)  Can you post the contents of the batch file?  

Author Comment

ID: 22628341
net use j: /del
net use I: /del

net use J: \\\
net use I: \\\

Imagine Time- Runs locally but everyone is connected to the DB on the server

Maybe there is a better way to do all this. Here is the entire problem. We have all of our programs setup though the remote apps. The program Imagine Time will not allow more than one person to connect through the terminal at a time. They (ImagineTime support) don't have experice with server 2008. They sent white papers on how to do setup Terminal Services 2003 (which I attached). Could you take a look at them and see if there is a better way to configure this?

Author Comment

ID: 22628351
Here is the instructions for setting up the program with terminal server 2003
Steps for ImagineTime Terminal Server Installation

These installation instructions will vary if you do not have a standard installation of ImagineTime, MS Office, or the

MS operating system. If this is the case please consult with your system administrator or IT department.

1. Use the 2003 Runtime of ImagineTime for this installation.

2. Login as administrator and install the full program (not workstation) in the default directory

c:\program files\bothworldssoftware\imaginetime.

3. Register the database with your user name and Id (Supplied in registration email/letter). Install

any options.

4. Close ImagineTime.

5. Copy the itcopy.bat (see page 2 a) file to the c:/documents and settings/all users/start

menu/programs/startup directory. This will refresh the front end program on each users profile

each day when they login.

6. Copy the ImagineTime icon from the desktop to the c:/documents and settings/All


(see page 2 b)

7. The registered Tbdata.mdb located in c:\Program files\bothworldssoftware\imaginetime should

be moved to a directory on the server near the root  s:\imaginetime (If s is the shared

network drive).

8. Re-link the front end database to the new location by re-opening the ImagineTime desktop icon

on the administrator desktop. It will ask for the new location when it fails to locate a database in

the default location.

9. All users must have read/write/file creation privileges for the s:\imaginetime directory (If s is

the shared network drive).

10. Users need to have access to the following files:

C:\program files\fms\total access emailer 2000\taemailr.mde




C:\Program Files\BothWorldsSoftware\ImagineTime\system.mdw

C:\Program Files\Common Files\Wintertree\Spelling\*.*

a) Create the following file and save it as Itcopy.bat;

@echo off

xcopy /q /y "c:\Program files\bothworldssoftware\imaginetime\TB2000.mde" "c:\documents and

settings\%username%\my documents\"

xcopy /d /q /y "c:\Program files\bothworldssoftware\imaginetime\TB2000.chm" "c:\documents

and settings\%username%\my documents\"

 Local applications directory could be substituted for my documents in the above example

depending on your system preferences.

b) The ImagineTime Icon in the c:/documents and settings/All Users/desktop folder

should have the following properties;


If using ImagineTime 2003 Runtime

"C:\Program Files\Microsoft Access Runtime\OFFICE11\StartAccess_2003.EXE" /excl /runtime

/profile "ImagineTime" /wrkgrp "C:\Program

Files\BothWorldsSoftware\ImagineTime\system.mdw" "C:\documents and

settings\%username%\my documents\TB2000.mde"

If using ImagineTime 2002/XP Runtime (old installations only)

"C:\Program Files\Microsoft Access Runtime\Office10\MSACCESS.EXE" /excl /runtime /profile

"ImagineTime" /wrkgrp "C:\Program Files\BothWorldsSoftware\ImagineTime\system.mdw" "

C:\documents and settings\%username%\my documents\TB2000.mde"

Start in:

"C:\documents and settings\%username%\my documents"

Shortcut key:



Normal window



Open in new window


Accepted Solution

corcent earned 0 total points
ID: 22702694
We ended up having to modify the batch file and also the desktop icon, because it was Server 08 the paths were not the same.

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now