atw: Windows Tips: Autoexec.nt and mapping local folders to a drive letter

  • From: Stuart Burnfield <sburnf@xxxxxxxxxxx>
  • To: austechwriter@xxxxxxxxxxxxx
  • Date: Tue, 4 May 2004 13:44:20 +0800




Tip 1. SUBST command in Windows/DOS

I wanted to use the SUBST command to map one of my local folders to
a drive letter. This is useful if you commonly work on files and
folders at the end of a long path, such as
c:\gentoo communications\projects\Work in Progress.
It gets very tedious if you're doing things like cross-book finds
that report the full path of each file:

Searching for: discuss
c:\gentoo communications\projects\Work in
Progress\ISPFUG1\f54ugcsi.ide(19): discussion of each type of connection.
c:\gentoo communications\projects\Work in
Progress\ISPFUG1\f54uglpc.ide(2567): <xref refid="passcom"> for further
discuss
c:\gentoo communications\projects\Work in
Progress\ISPFUG1\f54uglpc.ide(3490): </bibentry></cit> for a discussion of
the
c:\gentoo communications\projects\Work in
Progress\ISPFUG1\f54uglpc.ide(3876): mode. The text following discusses exc
c:\gentoo communications\projects\Work in
Progress\ISPFUG2\f54ugop3.ide(289): <xph>New name</xph> field, are discus

If you run this command:

   subst w: c:\gentoo communications\projects\Work in Progress

... then you can use the drive letter w: anywhere you would have
used or seen the folder name:

w:\ISPFUG1\f54ugcsi.ide(19): discussion of each type of connection.
w:\ISPFUG1\f54uglpc.ide(2567): <xref refid="passcom"> for further discuss

Tip 2. Autoexec.nt

In the old days we would have used c:\autoexec.bat to run commands
like this when DOS or Windows started up. This didn't seem to work
in Win 2000, so my  workaround was to make a batch file called
sdrive.bat and put it in my startup folder.

I just found in the Help that C:\WINNT\SYSTEM32\AUTOEXEC.NT is used
to initialize the MS-DOS environment. It's the Win 2000 equivalent of
autoexec.bat. There's also a CONFIG.NT, corresponding to CONFIG.SYS.

The comments at the top of AUTOEXEC.NT indicate that you can also
make custom copies to run particular applications. For example, if
you have a legacy application called JunkSoft Pro Gold that likes
to think it's running under DOS 5.0 or Win 3.0 or whatever, you can
create an autoexec.jnk containing commands that correctly set the
path, display, environment variables, etc, for JunkSoft. Specify
autoexec.jnk in JunkSoft's PIF, then when you launch it, it runs
happily in its special environment.

---
Stuart Burnfield
Information Developer
Australian Programming Centre

**************************************************
To post a message to austechwriter, send the message to 
austechwriter@xxxxxxxxxxxxxx

To subscribe to austechwriter, send a message to 
austechwriter-request@xxxxxxxxxxxxx with "subscribe" in the Subject field.

To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx with 
"unsubscribe" in the Subject field.

To search the austechwriter archives, go to 
www.freelists.org/archives/austechwriter

To contact the list administrator, send a message to 
austechwriter-admins@xxxxxxxxxxxxx
**************************************************

Other related posts:

  • » atw: Windows Tips: Autoexec.nt and mapping local folders to a drive letter