subst command in a batch file

E

egberto

I've made a batch file with the subst command:

subst c: e:\

however when I run this file, the dos window is opened and this line is
repeated endlessly, until I close the window. It is not executed. Help.
 
P

Pegasus \(MVP\)

I've made a batch file with the subst command:

subst c: e:\

however when I run this file, the dos window is opened and this line is
repeated endlessly, until I close the window. It is not executed. Help.

There are several problems with your batch file:
- Drive C: is most likely your system drive letter. It is
not available for substitution. Use a different letter.
- What is the point of your command? Substitution is
useful when assigning a drive letter to a folder, e.g.
subst L: "c:\My Documents\berto\Desktop".
- It is likely that you called your batch file "subst.bat".
This causes your looping problem. Never ever give
a batch file the same name as a system program - it
will cause you to pull out all your hair!
 
E

egberto

Pegasus said:
There are several problems with your batch file:
- Drive C: is most likely your system drive letter. It is
not available for substitution. Use a different letter.
- What is the point of your command? Substitution is
useful when assigning a drive letter to a folder, e.g.
subst L: "c:\My Documents\berto\Desktop".
- It is likely that you called your batch file "subst.bat".
This causes your looping problem. Never ever give
a batch file the same name as a system program - it
will cause you to pull out all your hair!

Thanks,
No I don't have a c: drive, that's why I wrote the batch file in the
first place; some programs don't work properly and this is the fix
recommended by Microsoft.

Changing the name to testxxxxx3.bat doesn't help, the looping problem
persists.
Indeed I lost some hair...
 
P

Pegasus \(MVP\)

You're right... it works
thanks both of you.

Now you see why I warned you about the loss of hair.
It took three people to resolve this one: Uwe, you, and me . . .
 

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