When i open my command prompt it defaults to my H drive and when i use cd /c: its not changing to the C drive. Please need help I have tried the following commands regsvr32 /u msolap.dll Thanks
4 Answers
When I use cd /c: its not changing to the C drive.
Note that the command above is incorrect, it should be cd c:\ or c:/.
If you want to change the current drive in addition to changing directory use the /d option:
cd /d c:\
Use the /D switch to change current drive in addition to changing current directory for a drive.
Example:
F:\test>cd c:\
F:\test>rem drive doesn't change
F:\test>cd /d c:\
c:\>rem drive changes
cd usage
c:\>cd /?
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 surrounding
the 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.
Further Reading
- An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
- cd - Change Directory - Select a Folder (and drive)
- 162,382
This how-to demonstrates how to easily change the default path in a command prompt.
Many people tend to run the command cd /d C:\ to do so. This is great but but running this command does not permanently change the path so you will have to change the path next time you open the Command Prompt.
Some people also edit the registry to achieve this but that is easier to mess up.
The last solution I've seen is to create a .bat that runs the command cd /d C:\ every time you open the Command Prompt. This causes an extra step and can cause confusion in the future.
The method in this How-to shows, in my opinion, the most direct and easiest way to change your default path.
2 Steps total
Step 1
Open the Command Prompt's Location
On the start screen / menu, type in "cmd", right-click it and select "Open File Location".
Step 2
Open the Command Prompt Properties and change the "Start In" Property Right-Click on "Command Prompt" icon, select "Properties", and edit the "Start In" property to your desired path. I used "C:\" as an example
When starting the command prompt, the default path will be the new path you've specified earlier
- 134
To add on to another comment above, if you are on Windows 10, you can accomplish this two ways. Open the start menu and type in cmd. Right click the Command Prompt app and select Open file location. Right click on the Command Prompt shortcut in the Explorer window that opens and select Properties, and change the Start in: field to C:\ or any location that you want Command Prompt to default to.
This same process can be repeated for PowerShell.
Note: If you have either Command Prompt or PowerShell pinned to your taskbar, hold shift and right click the icon and select Properties. You can change the same settings in that shortcut as well.
- 11