Print this page | Go back to previous topic
Forum nameThe Computer Forum
Topic subjectEdit CMD in another program
Topic URLhttp://www.pcqanda.com/dc/dcboard.php?az=show_topic&forum=2&topic_id=246296
246296, Edit CMD in another program
Posted by Josh N, Tue Aug-26-03 04:15 PM
How do you change the program that a CMD file (or any file that can be run and edited, ie: vbs, js, bat) is edited in? When looking under File Types, CMD isn't available. When looking at vbs, I'm not seeing what it is that changes the way it's edited.

TIA
246304, RE: Edit CMD in another program
Posted by SteveYandl, Tue Aug-26-03 05:17 PM
Josh,

I just place a shortcut to my favorite editor(s) in the SendTo folder and get in the habit of using that instead of the edit command. Sure, it is one more step in the context menu but it is consistent. There is an "edit" subkey for the batfile file type but I think some of the context menu stuff for scripting languages like vbs and js are buried in the scripting run time or other dll files.
246473, RE: Edit CMD in another program
Posted by Josh N, Wed Aug-27-03 12:54 PM
Thank ya Steve. This will work just fine.
246658, RE: Edit CMD in another program
Posted by R2, Thu Aug-28-03 02:13 PM
Send To will likely work fine.

However, if this is not what you desire, then it is a very simple registry edit to add an "Edit" right-click Context Menu item to any or ALL file extensions.


246776, RE: Edit CMD in another program
Posted by therube, Fri Aug-29-03 02:57 AM
And the simple registry edit is ...
246799, RE: Edit CMD in another program
Posted by R2, Fri Aug-29-03 06:12 AM
I left it open-ended because it would depend on the path to the exact program that the user desires to use as the Editor -- and whether or not the user wants it on all files or just .cmd files.

But... in WinXP, isn't there a fly-out "Open With >" option? That would be the simplest method.

(I use Win98 so I have to use a thid-party add-in.)
246428, RE: Edit CMD in another program
Posted by therube, Wed Aug-27-03 03:17 AM
I use the Vim (Gvim, unix text) editor.  It installs an
"Edit with Vim" right click option for all file
types.  I can right click any file & open it (whether
appropriate or not) in Vim.

I believe (NO GUARANTEES) these are the relevant registry
entries:

HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
"(Default)"
	Type: REG_SZ
	Data: {51EEE242-AD87-11d3-9C1E-0090278BBD99}
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
"(Default)"
	Type: REG_SZ
	Data: C:\TMP\GVIM\VIM\VIM61\gvimext.dll
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
"ThreadingModel"
	Type: REG_SZ
	Data: Apartment
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell
Extensions\Approved
"{51EEE242-AD87-11d3-9C1E-0090278BBD99}"
	Type: REG_SZ
	Data: Vim Shell Extension


(Actually the InProc... above probably will not apply).


This could probably be modified to use wordpad or whatever in
place of Vim.
246429, RE: Edit CMD in another program
Posted by therube, Wed Aug-27-03 03:18 AM
Here are some (somewhat) related articles.


<http://www.jfitz.com/tips/rclick_custom.html>
Customizing Right-Click Menu Options in Windows


<http://vim.sourceforge.net/tips/tip.php?tip_id=279>
On Windows, make GVim the default action for double-click with "unknown file types"
(be sure & read the full post)