Python Forum
windows command prompt modifications, add options, start loc, add copy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
windows command prompt modifications, add options, start loc, add copy
#1
change starting location of opening command prompt

This is a quick tutorial to change your command prompt auto start directory. Lets assume the directory starts in:
C:\Windows\System32
and you always change directory back to
 C:\Python33
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:
regedit.exe
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

3)
which should have DefualtColor, Default, etc. etc. etc. If no autorun create one by right clicking... New -> string value
rename to 
autorun
right click on it again, and choose modify
in Value data: insert
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:
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

Add copy and paste to command prompt
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

Open directory in command prompt right click drop down menu option
Open (registry editor) by typing regex.exe into start/run dialog. 

Navigate to key
HKEY_CLASSES_ROOT\Directory\shell
Right click shell and select New -> Key
rename this new key "CommandPrompt". Set this key's Data value to the text you want to see in the drop down menu "Open Command Prompt Here". 

Now right click on your new CommandPrompt key and make another new key below this key.
Right click CommandPrompt and select New -> Key
rename this new key "command" otherwise will not work. Set tis keys data value to 
cmd.exe /k cd %1
You do not have to restart, or close the registry editor for this to work. To do this you have to right click on a directory you want to open in cmd for the option to appear. This was tested on windows 10.

add linux commands to command prompt
Install cygwin. This is a separate shell with a collection of GNU and open source tools which adds functionality similar to linux. However once after you install cygwin, you can add add cygwins bin directory to windows path variable and execute the same commands in the windows command prompt. IF your not sure how to do that check this tutorial...but add your cygwin bin directory instead of python directory (example C:\cygwin64\bin)

Another option besides Cygwin is Cmder.
Recommended Tutorials:


Messages In This Thread
windows command prompt modifications, add options, start loc, add copy - by metulburr - Sep-05-2016, 09:06 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020