Changing path with batch file

D

daver676

I am attempting to create a small batch file in MS-DOS
edit mode. This batch file needs to change the DOS path in
order to run the rest of the file.

Here is the batch file code I have:

cd h:\inmass
IQ -nn04 UpdateTilburyShipping
IQ -nn09 UpdateSaltilloShipping
exit

Now this file runs fine on my computer, but on my
coworker's computer the end DOS window displays the
following:

C:\WINDOWS>cd h:\inmass

C:\WINDOWS>IQ -nn04 WeeklyTilburyShipping
Bad command or file name

C:\WINDOWS>IQ -nn09 WeeklySaltilloShipping
Bad command or file name

C:\WINDOWS>exit

Now it seems to me that the problem is that the path is
not changing. Also, the window doesn't close with the exit
command. Again, the path DOES change on my comp, but not
on my coworker's. Any ideas? PLease Help!

Dave
 
T

Torgeir Bakken (MVP)

daver676 said:
I am attempting to create a small batch file in MS-DOS
edit mode. This batch file needs to change the DOS path in
order to run the rest of the file.

Here is the batch file code I have:

cd h:\inmass
IQ -nn04 UpdateTilburyShipping
IQ -nn09 UpdateSaltilloShipping
exit

Now this file runs fine on my computer, but on my
coworker's computer the end DOS window displays the
following:

C:\WINDOWS>cd h:\inmass

C:\WINDOWS>IQ -nn04 WeeklyTilburyShipping
Bad command or file name

Hi

In the batch file, try

h:
cd h:\inmass

or alternatively (the same effect as above):

cd /d cd h:\inmass
 
H

Herb Martin

daver676 said:
I am attempting to create a small batch file in MS-DOS
edit mode. This batch file needs to change the DOS path in
order to run the rest of the file.
C:\WINDOWS>cd h:\inmass

You have a bunch of answers already from others but note that
CD doesn't change "DRIVES" by default -- it will happily change
the directory ON ANOTHER driver but not change your current
default.

Use the:
H:
cd H:\wherever

OR

Use CD /d H:\Somewhere

to do both together.

Or someone suggested the PUSHD (you can get back easily that way.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top