Windows Command Prompt – Command to Change Path to Default Directory

command linewindows 7

Is there a command to change the current directory to default directory? (I'm not asking about permanently changing the default directory, here!)

For example, if the current directory is "..\xyz" and my default command prompt directory is D:\Abc, is there a way to navigate directly to D:\Abc (without giving >cd D:\Abc)?

Best Answer

There's no option built into cd to do this but you could certainly create a .cmd script file that does it. For example, you could put this into a home.cmd file somewhere on your search PATH and go to D:\Abc just by typing home:

@ echo off
cd /D D:\Abc