Solved

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

Posted on 2008-10-02
15
747 Views
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?
0
Comment
Question by:corcent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
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.

0
 

Author Comment

by:corcent
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.
0
 
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>

J:\program.exe

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

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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

Author Comment

by:corcent
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.
0
 
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).

0
 

Author Comment

by:corcent
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
0
 
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.  

0
 

Author Comment

by:corcent
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.

0
 
LVL 40

Expert Comment

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

Author Comment

by:corcent
ID: 22627994
We created the batch file and installed it through the terminal and it just brings up the remote desktop login box
0
 
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?  
0
 

Author Comment

by:corcent
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?
0
 

Author Comment

by:corcent
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
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

0
 

Accepted Solution

by:
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.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

726 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