Question:

How do I navigate using command prompt?

by Guest21486  |  earlier

0 LIKES UnLike

Ok, I am a greenhorn in using command prompt. If I want to go to C drive, I type C:

If I want to go to F drive, I type F:

Ok, now if my file is save on desktop, what do I type?

or if it's save in my document, what do I type?

Please give precise instructions.

Thanks!

 Tags:

   Report

6 ANSWERS


  1. The desktop folder is called "Desktop" and is in your home directory.  Under Windows, the home directory is in the "USERPROFILE" environment variable.  So, to set the current directory to your desktop:

    cd  /d  %userprofile%\desktop

    Note the "/d" flag.  This makes sure that the current drive is also set.

    The "My documents" folder is the same thing:

    cd  /d  "%userprofile%\my documents"

    (Note the quotes, required because "my documents" contains a space.)

    - kb -


  2. IMO, mdigital's answer is the best of the ones I see. "cd" (or chdir) is the key to changing directories and thereby navigate a file system.

    Tip: Type "cd \" to get to the root (top) of the current drive from anywhere else in the heirarchy.

    "cd" is most useful when you know what directory to follow it with. To get to know a directory (or folder) structure from the command line, use "dir" to list the contents (files and subdirectores) of the directory you are in.

    Use "dir /s" to list the contents of the directory and its subdirectories.

    Use "dir /ad" to list only directories, no files.

    Use "dir /s/ad" to list directories-only for the current folder and all subfolders.

    Use "dir /s/ad/b" to list just directory names, without statistics.

    Use "dir /?" to list all the possibilities.

    You can usually combine several switches in one command, as illustrated. You can also find information and examples about command-line commands in Help and Support in the Start menu.

    Type Ctrl+C to abort a command that you find is running too long for your patience.

    The "tree" command will show directories in a tree-structure like the one in Windows Explorer. Entering "tree /a" will display the tree using characters that you can copy and paste (or redirect (">")) into a document. Once you know more about the directory structure, you will know what to type to get somewhere.

    Most Windows command prompts will fill in or complete folder names or file names for you if you press tab. For example type "cd c:\prog" then press tab, and the system will complete the path as "cd "C:\Program Files"" and put the quotes around it too, if it has embedded spaces. You don't even have to type anything to list files and folders one at a time. If you hit "tab" at a command prompt, the system will list files and directories one by one. Once you see the one you want, you can edit the command-line to do what you wish, like adding "cd " ahead of a directory of interest.

    If I type "help" at a command line in Windows XP Pro, it lists most of the commands available and a brief description of each.

  3. You need to know the directory structure you are trying to navigate.  The location of these folders varies depending on what operating system you are using.

    cd is the command for "change directory"

    so if the directory was stored in c:\documents and settings\admin\desktop

    you would type cd c:\"documents and settings"\admin\desktop

    *note that you need quotes around "documents and settings" because there are spaces in that directory name

  4. just type "My Documents" and "Desktop"..

  5. check out this page

    http://www.commandpromptcommands.com/

    if you type the command followed by /? it will list command switches.

    EX.

    find /? then hit enter key

    Searches for a text string in a file or files.

    FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[ ...]]

      /V        Displays all lines NOT containing the specified string.

      /C        Displays only the count of lines containing the string.

      /N        Displays line numbers with the displayed lines.

      /I        Ignores the case of characters when searching for the string.

      "string"  Specifies the text string to find.

      [drive:][path]filename Specifies a file or files to search.

    If a pathname is not specified, FIND searches the text typed at the prompt

    or piped from another command.

  6. use CD command to enter a folder inside the folder you already are in

    use CD..  to go back to the previous folder.

Question Stats

Latest activity: earlier.
This question has 6 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.