Link to home
Start Free TrialLog in
Avatar of Corcent
Corcent

asked on

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

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?
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

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.

Avatar of Corcent
Corcent

ASKER

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.
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>

J:\program.exe

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

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.
Avatar of Corcent

ASKER

I will add that to the script, but i do not understand what J:\program.exe is for at the end of the script.
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).

Avatar of Corcent

ASKER

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
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.  

Avatar of Corcent

ASKER

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.

Yeah, then opening the mdb directly should be fine.
Avatar of Corcent

ASKER

We created the batch file and installed it through the terminal and it just brings up the remote desktop login box
does it run locally?  (EG: without remote apps or anything?)  Can you post the contents of the batch file?  
Avatar of Corcent

ASKER

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?
Avatar of Corcent

ASKER

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
Users/desktop.
(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:\windows\system32\ctmday.ocx
C:\windows\system32\ctdate.ocx
C:\windows\system32\ctschedule.ocx
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;
Target:
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:
None
Run:
Normal window
Comment:
ImagineTime

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Corcent
Corcent

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