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:
HKEY_CURRENT_USER/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:\
New Users, Read This
version Python 3.3.2 and 2.7.5, tkinter 8.5, pyqt 4.8.4, pygame 1.9.2 pre
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
User avatar
Posts: 1103
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 0 guests