Right click to Dos

  • From: "Registry Answers" <regtips@xxxxxxxxxx>
  • To: "Registry Answers" <regtips@xxxxxxxxxxxxx>
  • Date: Tue, 18 May 2004 12:02:15 -0400

Registry Answers 
May 18, 2004 - Issue 9

Right Click to Dos

This issue's question asks about an old tip I first used when Windows 95 was 
released. However, it can still come in handy
today and works on all versions of Windows,  from 95 to XP. It adds a Dos 
option to the right click menu of all your folders.
I will also show how you can remove the Microsoft copyright notice that you see 
at the top of the Dos window everytime you start a Dos session.
Not that this is anything very useful, but more for your knowledge and because 
it is very simple to do.

Note
Registry Answers assumes a basic understanding of the Registry. If you consider 
yourself a Registry newbie or would like to learn 
the Windows Registry from the ground up in plain english, order the ebook 
Registry for Newbies.
http://newbieclub.com/rfncopy/?vic

For other Windows tips, you may also want to subscribe to Wintips&Tricks. 
//www.freelists.org/webpage/wintips

Also, you may see expanded html versions of select Registry Answers and 
Wintips&Tricks articles at
ABC
http://www.personal-computer-tutor.com/abc/
and TechTrax
http://pubs.logicalexpressions.com/Pub0009/LPMIssue.asp?ISI=0

Recent expanded articles

1. Registry Data Types (April 17 issue)
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=361

2. IE Autocomplete Passwords (March 15 issue)
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=348

For a related article that deals with adding and removing entries from the 
right click menu, in general,  see my ABC article

How To Remove and Add Right-Click Menu Items from Files and Folders  (Volume 11 
- April 2002 issue)
http://personal-computer-tutor.com/abc2/v11/vic11.htm

Now on to this issue's question and topic.

Right Click to Dos

Question:  In Windows 98, I used the old Powertoys 95  to put Dos on my right 
click menu. Can the same be done in Windows XP?
Is there a registry method to do this?

Yes, this can be implemented on all versions of Windows, from 95 to XP

What the poster is talking about is a Powertoy 95 utility named "Command 
Prompt" that puts access to Windows Ms-Dos on the right click menu of all 
folders. 
A main convenience of this is that no paths need to be typed when you need to 
perform a Dos action on some file.You simply right clickt he folder containing 
the
file, choose the Dos option, and the Dos window opens with that folder set as 
the current working directory. Then you simply enter your command.  
Example, say you need to use the command line to delete a file that is 
contained in a folder named Videos located here:

C:\Documents and Settings\John\Desktop\My Stuff\Graphics\Family Photos\Videos

Before you could delete the file, you would have to get to that Videos folder  
- normally, you would use the cd command to get to it or you would type the
whole path or maybe copy-paste the path at the prompt. Not very convenient or 
quick.  However, with a Dos option in the right click menu, all you would need
to do is right click the Videos folder and the path would be set at the prompt 
automatically.  Then it would be just a matter of entering your command.
i.e. DEL MYFILE.AVI instead of
C:\Documents and Settings\John\Desktop\My Stuff\Graphics\Family 
Photos\Videos>DEL MYFILE.AVI 

Tip -  this could also be handy to get a quick directory listing of any folder 
outputted to a text file or document.
You would just right click the folder of your choice, choose your Dos option 
and type, for example,
DIR /a /b /o>dirlist.txt  which would produce a text file in that folder 
listing all the files it contains without the paths included.
Or type Dir /a /s /o >dirlist.txt to get a listing of all files including those 
in any subfolders



The old Powertoy 95 utility to add the Dos option should work in XP as well, 
but since this newsletter is about learning the registry and the secrets
behind such utilites, here I will show you how to do it yourself using the 
registry which is what the question asks, anyway.


1. Click Start>Run, type regedit, click Ok and make your way to the 
Directory>shell key::

HKEY_CLASSES_ROOT\Directory\shell

2. Right click the shell key and choose New>Key.
3. Name it  Dos From Here
4. Right click  the new "Dos From Here" key and create another key named command
5. With command selected, double-click Default  in the right hand pane.
This will open the Edit String box.

6. If you're using  Windows 95/98/Me enter this command as the Value Data

command.com /k cd "%1"

If you're using  Windows NT/2000/XP enter this command as the Value Data

cmd.exe /k cd "%1"


7. Click Ok, exit the registry, and you are done. 


To test, right click any folder. You should now see a Dos From Here option.
Try it out - you should see the path of the folder you selected set at the 
prompt.
(this path is what we call the Current Working Directory)

Notes and Tips

1. If you find that the paths at the prompt do not display in long name format 
- i.e. you get
C:\DOCUME~1>
instead of 
C:\Documents and Settings>

change the  "%1" used in the in the command line to "%L" so that the command 
looks like this:

cmd.exe /k cd "%L"

This should ensure that the paths display in long file name format (this seems 
to be a problem mostly for XP users)
Secret:  If you enter the FULL path to cmd.exe, you should get long file names 
displayed even without the L switch.
ie
C:\Windows\System32\cmd.exe /k cd "%1"
or even just
System32\cmd.exe /k cd "%1
should do it


2. The Dos we are talking about here is Windows Ms-Dos, not Native or Real Mode 
Dos.
In Windows 9x, it's the Dos you get when you click Start>Run and type Command.
In the other systems, which don't have real Dos to start with, it's what you 
get when you
click Start>Run and type cmd

3.. The name you see on the context menu doesn't have to be Dos From Here.You 
can make it whatever you prefer. Whatever you enter in Step 3, 
will be what you see in the right click menu.
Secret - the name you use would be overidden if you entered a different name as 
Default in the right hand pane.
For example, if you name the key "Dos From Here" and then double click Default 
in the right hand pane and enter
"Dos Prompt", then Dos Prompt is what you will see in the right click menu, not 
"Dos From Here"


5. Adding a Dos option to the right click menu can also be done without having 
to enter the registry. You can make these changes in
Folder Options (File Types) You would select File Folder, click Edit and then 
create a new action and then enter the command for it.
And, of course, you can always use Power Toys to do this 

6. Removing the Microsoft Copyright Notice

The /k  switch you see in the command line is needed to ensure the Dos window 
remains open after the commands are executed..
but if you notice, the /k switch also removes the Microsoft copyright notice 
from the top of the dos window. 
To see the difference, click Start>Run and if using 9x, type command, and press 
Enter. 
If using XP, type cmd and press Enter.
Notice the copyright notice taking up space at the top of the window.
Now enter command or cmd again, but this time add /k to the end of it.
ie
command /k
cmd /k
The Microsoft notice should now be gone.

Tip - you can add the /k switch to the end of the command line of the Dos 
shortcuts you have in your Programs folder.

In 9x, click Start>Programs and right click the MS_DOS Prompt  entry. Go to 
Properties and under the Program tab add /k to the
end of the command line i.e. C:\WINDOWS\COMMAND.COM /k


In XP, you will find the shortcut in your Programs>Accessories folder.
Right click the  Command Prompt entry,  go to Properties, click the Shortcut 
tab, and add the /k to the end of the command line in
the Target field. i.e. %SystemRoot%\system32\cmd.exe /k

Of course, you can always make your own desktop Dos shortcuts with or without 
the /k switch.
Just right click your desktop, choose New>Shortcut and enter the appropriate 
command for your system.
Or you can just drag command.com or cmd.exe to your desktop to create a 
shortcut to them
Tip - instead of creating a shortcut, copy command.com or cmd.exe to your 
desktop. They are both very small files.
By copying, the path at the prompt when you double click them, will be your 
desktop instead of your Windows or System folder.

vic
If you have a question or tip you would like to have considered for submission, 
send it to:
regtips@xxxxxxxxxx?Subject=feedback

Help keep these newsletters free
Vic's Printer Suppliers
You can help keep these newsletters free and save money at the same time by 
bookmarking
and using this page for all your printing supply needs.
http://www.personal-computer-tutor.com/printersupplies.htm

Thank you for your support and I hope you find my newsletters and articles 
helpful.

vic

If this was forwarded to you and you would like to subscribe to Registry
Answers, click here and hit Send
regtips-request@xxxxxxxxxxxxx?Subject=subscribe

To unsubscribe, click here and hit Send
regtips-request@xxxxxxxxxxxxx?Subject=unsubscribe

Home Page
//www.freelists.org/webpage/regtips

Other related posts:

  • » Right click to Dos