Re: subst command in a batch file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Pegasus (MVP) wrote:
<egberto@xxxxxxxxxxxxxx> wrote in message
news:1150794294.351761.201930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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!

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

.



Relevant Pages

  • Re: subst command in a batch file
    ... however when I run this file, the dos window is opened and this line is ... is most likely your system drive letter. ... not available for substitution. ... - It is likely that you called your batch file "subst.bat". ...
    (microsoft.public.windowsxp.general)
  • Re: just starting
    ... Write a batch file that runs the program and then ends with a PAUSE command ... it flashes open the DOS window and closes quickly ... ... the properties tab has Misc, ... the misc tab has an option for "close on exit" ...
    (comp.programming)
  • Re: Positioning a DOS Window
    ... VBA shells out to run a batch file ... So I have inserted a MsgBox - ... So I wanted the DOS window to hide ...
    (microsoft.public.excel.programming)
  • Re: Digital signing
    ... opens a dos window for output purposes. ... However, you said "build script". ... wrong (I even went as far as coding a dos batch file). ... app and build the install in one go. ...
    (microsoft.public.vb.general.discussion)
  • RE: Automatically Save a file on the Desktop
    ... A mapped drive will have a drive letter like H:. ... End Sub ... network admin can setup the Documents and Settings to be the PC local drive ... Start - Run - cmd.exe (this will open a DOS window) ...
    (microsoft.public.excel.programming)