[comp.os.msdos.misc] Swapping logical device names under DOS?

wah@MAPS.CS.CMU.EDU (Wilson Harvey) (01/31/91)

This must have been asked many times.

I have a NEC PowerMate 286+ with two internal floppy drives (5.25" and 3.5").
These are set up as A: and B:, respectively.  Periodically, I need to be able
to switch the logical names (so that the A: drive is the 3.5" and the B: drive
is 5.25").  Ideally, this would be done with a command file.

Can anyone clue me in on how to do it?  I'm currently running under DOS3.2, but
I will soon be upgrading to DOS4.0.

Thanks for your help.

-- 

W. A. Harvey			INTERNET: wah@cs.cmu.edu
School of Computer Science	CSNET:    wah%cs.cmu.edu@relay.cs.net
Carnegie Mellon University	BITNET:   wah%cs.cmu.edu%smtp@interbit
Pittsburgh, PA  15213-3890	UUCP:     ...!seismo!cs.cmu.edu!wah
412-268-7552

jkavanau@eecs.wsu.edu (Jeff Kavanaugh) (02/01/91)

In article <1991Jan30.201844.13348@cs.cmu.edu> wah@MAPS.CS.CMU.EDU (Wilson Harvey) writes:
>This must have been asked many times.
>
>I have a NEC PowerMate 286+ with two internal floppy drives (5.25" and 3.5").
>These are set up as A: and B:, respectively.  Periodically, I need to be able
>to switch the logical names (so that the A: drive is the 3.5" and the B: drive
>is 5.25").  Ideally, this would be done with a command file.
>
>Can anyone clue me in on how to do it?  I'm currently running under DOS3.2, but
>I will soon be upgrading to DOS4.0.
>

DOS has a file called ASSIGN.COM. It is used just for this purpose.
Suppose you want the A: to be B: and vice-versa. Execute the following:
	
	ASSIGN A: B:

	ASSIGN B: A:

This may not fool all installation software but will work with most apps.
-- 
----------------------------
       Jeff Kavanaugh
(jkavanau@yoda.eecs.wsu.edu)
----------------------------

wah@MAPS.CS.CMU.EDU (Wilson Harvey) (02/01/91)

There seems to be at least two ways of doing this.

Thanks to Ralf Brown for the first suggestion, which is to use the ASSIGN
command.  I can create a batch file with the single line 'assign a=b b=a'
in it, and this will swap the logical device names (temporarily, of course).
I can undo this by issuing another 'assign' (no arguments).

Thanks also to Brad Hines and Lea Fester for suggesting another method that
makes use of the SUBST command.  It is an open question as to whether this
allows one to *swap* the names of the drives.  It will, however, allow one
to use INSTALL scripts that assume that you are installing from the A: drive.
The following sequence of commands illustrates:

	# Assume that your hard drive is C: and your floppy is B:
	mkdir c:\scratch
	cd c:\scratch
	copy b:\*.*
	subst a: c:\scratch
	a:
	install

(I embellished an example from Brad Hines, so I bear any responsibility for
inaccuracies.)

I cannot comment on the relative merits of either method.  I used the first
method, as it seemed easiest; it worked just fine for my problem.

Others lamented my "upgrade" from DOS3.2 to 4.?; I appreciate your
sympathies.

Again, many thanks to all those who sent replies.

-- 

W. A. Harvey			INTERNET: wah@cs.cmu.edu
School of Computer Science	CSNET:    wah%cs.cmu.edu@relay.cs.net
Carnegie Mellon University	BITNET:   wah%cs.cmu.edu%smtp@interbit
Pittsburgh, PA  15213-3890	UUCP:     ...!seismo!cs.cmu.edu!wah
412-268-7552