windows command prompt [change starting directory]

A place where you can post Python-related tutorials you made yourself, or links to tutorials made by others.

windows command prompt [change starting directory]

Postby metulburr » Sun Jul 07, 2013 5:00 pm

This is a quick tutorial to change your command prompt auto start directory. Lets assume the directory starts in:
Code: Select all

and you always change directory back to
Code: Select all

At this point it is highly a convenience change for beginners with the command line, and thats it. You can go the GUI way or just insert a command in the command prompt (see below)

1) type in start:
Code: Select all

and click on response, which should bring you to the registry editor

2) in the registry editor navigate path to:
win 7/8
HKEY_CURRENT_USER/Software/Microsoft/Command Processor
in Win 10 the path is
HKEY_LOCAL_MACHINE/Software/Microsoft/Command Processor

which should have DefualtColor, Default, etc. etc. etc. If no autorun create one by right clicking... New -> string value
rename to
Code: Select all

right click on it again, and choose modify
in Value data: insert
Code: Select all
cd /d C:\Python33

If there is an autorun string value already, then just change existing one

Or to simplify the whole thing just execute this in your command prompt:
Code: Select all
reg add "HKCU\Software\Microsoft\Command Processor" /v autorun /t REG_SZ /d
"cd /d c:\Python33"

4) open a new command prompt and it should auto change directory to the directory you specify, which in this case is C:\Python33

Other modifications to the command console:
copy and paste from command console. By default this option is off. Open a command prompt, right click on the top panel -> Properties. check Quick Edit Mode. From there you can copy text from the command prompt by dragging the mouse over text and right clicking (which auto puts it into your clipboard), right click again to paste back into command prompt, or a regular manner with a drop down menu
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 2058
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest