Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 778
  • Last Modified:

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?
0
corcent
Asked:
corcent
  • 8
  • 7
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
 
corcentAuthor Commented:
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
 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
 
corcentAuthor Commented:
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
 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
 
corcentAuthor Commented:
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
 
Kyle AbrahamsSenior .Net DeveloperCommented:
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
 
corcentAuthor Commented:
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
 
Kyle AbrahamsSenior .Net DeveloperCommented:
Yeah, then opening the mdb directly should be fine.
0
 
corcentAuthor Commented:
We created the batch file and installed it through the terminal and it just brings up the remote desktop login box
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
does it run locally?  (EG: without remote apps or anything?)  Can you post the contents of the batch file?  
0
 
corcentAuthor Commented:
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
 
corcentAuthor Commented:
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
 
corcentAuthor Commented:
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.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now