Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to use "cd" command in Windows

21 Jul 2011   #1
dotancohen

Ubuntu Linux
 
 
How to use "cd" command in Windows

Hi all, I'm a Linux user just starting to get the hang of Windows 7. How can one perform these functions with the Windows cd command:
1) Go back to the previous directory (cd - in Bash)
2) Go to the user's home directory (cd ~ in Bash)
3) Bookmark a directory (not built into bash, but cdargs or DerB can be added)

Thanks


My System SpecsSystem Spec
.
21 Jul 2011   #2
mickey megabyte

ultimate 64 sp1
 
 

1) to go back a folder try cd.. - ie cd 'dot' 'dot'

i'm not sure about the other two apart from cd users\[username]

you may find this link useful for other commands.
My System SpecsSystem Spec
21 Jul 2011   #3
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

I don't think it can. If you type help cd you will get the full list of options.
My System SpecsSystem Spec
.

21 Jul 2011   #4
t-4-2

Windows 7 Home Premium 64-bit, SP1
 
 

Quote   Quote: Originally Posted by dotancohen View Post
Hi all, I'm a Linux user just starting to get the hang of Windows 7. How can one perform these functions with the Windows cd command:
1) Go back to the previous directory (cd - in Bash)
2) Go to the user's home directory (cd ~ in Bash)
3) Bookmark a directory (not built into bash, but cdargs or DerB can be added)

Thanks
I know absolutely nothing about this subject.
Found this site. Wonder if it can help any ...
MS-DOS cd command help
My System SpecsSystem Spec
21 Jul 2011   #5
dotancohen

Ubuntu Linux
 
 

Quote   Quote: Originally Posted by mickey megabyte View Post
1) to go back a folder try cd.. - ie cd 'dot' 'dot'

i'm not sure about the other two apart from cd users\[username]

you may find this link useful for other commands.
Thanks, but that goes up one directory, not back to my previous directory. The link has some good info, though it's cd page does not address the issue. Thanks.

I actually expected that this would be a common need, I'm surprised that Windows does not have this and that there are no other Windows admins posting about such an obvious feature.
My System SpecsSystem Spec
21 Jul 2011   #6
mickey megabyte

ultimate 64 sp1
 
 

sorry, i misunderstood your question about previous directory. i'm really not much of a command-line guy any more...it's so twentieth century
My System SpecsSystem Spec
21 Jul 2011   #7
pparks1

Windows 7 Ultimate x64
 
 

Most Windows admins go to the command line as little as humanly possible. Trust me, unless you came from the DOS days, you probably aren't using the command line for hardly anything.

As far as I know (A linux admin), there aren't commands like you want in the basic command prompt. Windows has been working on bringing more functionality to the command line through the powershell.

In my eyes, the command line is one of the best tools for setting anything up and documentation is a breeze. I can give a list of 10 commands and simply have somebody cut and paste them and they are right every single time. Beats the pants of trying to walk everybody through all of the windows, radio button, checkboxes and next, next, next finishes in the Windows server gui.
My System SpecsSystem Spec
21 Jul 2011   #8
kado897

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bit Service Pack 1
 
 

Been doing some investigation.

You can get to your home directory with cd %homepath%

If you type set with no arguments it gives you a list of the currently set environment variables. Any of them that are valid paths can be used like this. You can also set your own variables with the set command. Not sure how long the variable persists. You need to look at help set for all the details.
My System SpecsSystem Spec
21 Jul 2011   #9
dotancohen

Ubuntu Linux
 
 

I came from the Commodore days, spent some time in DOS and Windows though. How can there not be a back command in the Windows CLI? Does the Windows default web browser have a back button?

Wow, I just checked: the Windows 7 default file manager doesn't have an Up button!
My System SpecsSystem Spec
21 Jul 2011   #10
dotancohen

Ubuntu Linux
 
 

Quote   Quote: Originally Posted by kado897 View Post
Been doing some investigation.

You can get to your home directory with cd %homepath%
Thanks! I've also since discovered the pushd and popd commands, which though don't address my other two concerns might at least help me get by.

Have a great evening!
My System SpecsSystem Spec
Reply

 How to use "cd" command in Windows




Thread Tools




Similar help and support threads
Thread Forum
Run "cmd.exe" as a given user and "as administrator" in command line
Hello and thank you for reading my post. If I'm logged in Windows as user "u1", I can execute "cmd.exe" "as administrator" by choosing "Start" -> "cmd.exe" and right-click "Run as administrator".I would like to start another "cmd.exe" console as "u2" and "as administrator". (So, "u2" is not...
General Discussion
Need to add "TASKBARS" (MSese for "Launchpads", "Docks" NOT "Toolbars"
My office just upgraded, and I can no longer use Windows XP. On this system, I was able to add a separate taskbar to facilitate quick access to commonly-browsed folder locations on our vast network, and another one expedited the launching of useful programs and lists. Each task on each taskbar...
General Discussion
disable "use visual styles on windows and buttons" through a command?
hello, i what to know about a way to disable and enable the "use visual styles on windows and buttons" option by a command.. i want to do that every time i run a game.. it is improvs the performance significantly in games and especially in Emulators.. thanks for helpers!
General Discussion
No REG Command in "Open elevated command window here" DOS Box
I have used the @="cmd.exe /s /k pushd \"%V\"" type of Registry mod to obtain a context menu "Open elevated command window here" menu item, such as in the "Open elevated command window here" thread ( https://www.sevenforums.com/general-discussion/75069-open-elevated-command-window-here.html ). ...
General Discussion
"dependency chain" "windows 7" internet "windows explorer"
"dependency chain" "windows 7" internet "windows explorer" At the time of this writing, this search in Google will produce one result at best. Am I searching the wrong things? I have tried a couple handfuls of variants, and I am coming up with zilch. Though I am fairly well versed in...
System Security
Problems about windows 7 "open command window here" shift-right click
When I clicked on "open command window here" on shift-right click menu. It shows me an error message as the attachment. Before it works fine until last month. Does Windows last update update caused that problem or I did something wrong?
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:47.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App