Computing.Net > Forums > Disk Operating System > Changing Drives with one command

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Changing Drives with one command

Reply to Message Icon

Name: Kartick
Date: February 25, 2001 at 15:48:20 Pacific
Comment:

Hi,

I want to write a batch file which allows the user to change drives *and* directories with one command. I am not sure if I should use one or 2 variable parameteres. Any help would be great.

Thx,
Kartick



Sponsored Link
Ads by Google

Response Number 1
Name: drexhex
Date: February 25, 2001 at 19:19:50 Pacific
Reply:

Batch file contents:

@echo off
%1
cd %2

Usage: (drivedir.bat)

C:\> drivedir d: \shared\usrfiles

Make sure the \ is there otherwise if the root is not current, you will get an error.

Only works in DOS, Win95/98. Did not test with ME.
Should work, though. ;-D

dX


0

Response Number 2
Name: Laurence
Date: February 27, 2001 at 12:19:29 Pacific
Reply:

Even better is:

:: cdd.bat
:: example: cdd c:\bat
@ECHO off
%1.\
CD %1
::

Or you can do it with a doskey macro:

DOSKEY cddir=$1\$Tcd $1


Batfiles: The DOS batch file programming handbook



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Hard drive with no hard d... HELP: how to make laptop ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Changing Drives with one command

change a DSN with DOS commands www.computing.net/answers/dos/change-a-dsn-with-dos-commands/14084.html

how to change drive letter's in DOS www.computing.net/answers/dos/how-to-change-drive-letters-in-dos/4729.html

Can DOS verify valid drives with a batch www.computing.net/answers/dos/can-dos-verify-valid-drives-with-a-batch/7491.html