How do I change default startup directory for command prompt in Windows 7?
I usually do the following to start command prompt from C:\\
WIN-R (Run Promp
One easy way to do it + bonus.
Start cmd
with administrator rights, the default directory for the prompt will be C:\WINDOWS\system32
.
I created a bat file in that directory (notes.bat
)
Opened it with notepad and wrote the following lines. Each line is followed with a comment which should not be added to the bat file.
@echo off
prompt $S$CYourNamel$F$S$G$S
/* This is a comment, do not include it in the bat file - above line will make the prompt look like (YourName) > */
cd C:\Your_favorite_directory
/* This is a comment, do not include it in the bat file - above line will navigate you to your desired directory */
Saved the file and that was it.
Now when You open cmd
with admin rights, just write: notes
or notes.bat
and it will execute the notes.bat
file with desired changes.