Jump to content

how to CD (ChangeDirectory) from one drive to another?


liorshwa

Recommended Posts

if im working with cmd and my current location is:

C:\

so i type:

cd F:\

and it stays on disk c and it doesnt change?!

Link to comment
Share on other sites


  • Replies 5
  • Views 1.1k
  • Created
  • Last Reply

you want to change int othe E: drive at command prompt?
type the below at the C:\> prompt:E:That's all!

When in windows, you want to open the drive in explorer, type the same as above into the "Run" box or address bar.


An interesting thing is, if you are in C:\ drive (at command prompt) and want to go directly to E:\games, you'd run the following command:cd /D E:\gamesinstead of two consecutive commandsE: (to go to drive)
cd games (to change current working folder to that one)

http://www.msfn.org/board/topic/28569-cmd-change-to-e-drive/
Link to comment
Share on other sites


UkoBlackHat97
Displays the name of or changes the current directory.
CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]
.. Specifies that you want to change to the parent directory.
Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.
Use the /D switch to change current drive in addition to changing current directory for a drive.
If Command Extensions are enabled CHDIR changes as follows:
The current directory string is converted to use the same case as the on disk names. So CD C:\TEMP would actually set the current directory to C:\Temp if that is the case on disk.
CHDIR command does not treat spaces as delimiters, so it is possible to CD into a subdirectory name that contains a space without surroundingthe name with quotes.
For example:
cd \winnt\profiles\username\programs\start menu
is the same as:
cd "\winnt\profiles\username\programs\start menu"
which is what you would have to type if extensions were disabled.

if you want to change the drive letter, simply run this command:

example for "D" drive letter => CD D: /d or CD /d D:

Hope this will help :)

Link to comment
Share on other sites


Another handy commands use:

Dir/w/a/p <- This gives your a dir listing, plus attributes with an option to pause the list so it doesn't scroll past.

cd\ <- Takes you back to the root dir

cd.. <- Takes you back on parent folder

Oh I miss DOS.

Link to comment
Share on other sites


Depending on what you are tring to do you might have to assign the drive letter for system to find the drive. You can adjust this to suit your needs. Hope this helps.

Example to run a file on a different drive letter in a "cmd file":

FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO ( ::assigns drive letter::
IF /I EXIST "%%i:\yourfile.exe" ( "%%i:\yourfile.exe" ) ::runs a file from that assigned drive letter::
) ::closes the DO function::

From the first post you say you cant goto another drive using the cd command in a opened command prompt window, right? Try right clicking on command prompt shortcut and run as admin then do cd d:\ or what ever....it will work then if you are an admin user. The above example is if running a "cmd file" and needing to call another drive location.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...