• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

running a program from a BAT

I am trying to run a program from within a BAT file.

It maps a drive

Net use T: \\server\share

T:\setup.bat


The problem I am having is that it runs the program in the context of the c: not the t: and I need it to run as if from the t:

If I open the drive and double slick it works, or if from the CMD I put in cd t: the type setup.bat it works fine.

What can I do to make the BAT file run the program from within the t: ?
0
ChicagoMikeW
Asked:
ChicagoMikeW
  • 2
2 Solutions
 
fetch_Commented:
use:

T:\

above where you reference the .bat file.  It changes your context to T:  You could also use absolute paths instead of referential paths.
0
 
SteveGTRCommented:
I'd recommend this:

Net use T: \\server\share

cd /r t:\

T:\setup.bat
0
 
SteveGTRCommented:
Opps, wrong switch. It should be /d:

Net use T: \\server\share

cd /d t:\

T:\setup.bat
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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