- .BAT right-click Edit command runs batch file, doesn't open editor
- Posted by CHENRYD on February 17th, 2006
I don't know when or how this came to be, but I noticed today that when I
right-click on a .bat file and select edit from the menu, the .bat file
begins to execute instead of opening in the editor. I tried running the
registry restore file (batch_file_assoc.reg) at www.dougknox.com that I'd
seen recommended to put back the default registry entries for the file
association, but it didn't change the behavior at all. Anybody have any
ideas as to what else might be the problem?
Chip Damsel
- Posted by Wesley Vogel on February 17th, 2006
Windows® XP File Association Fixes
Copyright 2003 - Doug Knox
http://www.dougknox.com/xp/file_assoc.htm
Batch File Association Fix (Restore the default associations for BAT files)
-----
These are the batfile context menu options:
Open
Edit
Print
Doug Knox's fix includes the registry entries that are related to the right
click context menu. However, the fix doesn't remove what should not be
there!
Open Registry Editor...
Start | Run | Type: regedit | Click OK |
See if you have this key
HKEY_CLASSES_ROOT\batfile\shellex\ContextMenuHandl ers
You should not have that key!
Delete the ContextMenuHandlers key if it exists.
Edit Gone from your Context Menu?
http://www.serverwatch.com/tutorials...le.php/1475871
You should have these keys...
HKEY_CLASSES_ROOT\batfile
HKEY_CLASSES_ROOT\batfile\DefaultIcon
HKEY_CLASSES_ROOT\batfile\shell
HKEY_CLASSES_ROOT\batfile\shell\edit
HKEY_CLASSES_ROOT\batfile\shell\edit\command
HKEY_CLASSES_ROOT\batfile\shell\open
HKEY_CLASSES_ROOT\batfile\shell\open\command
HKEY_CLASSES_ROOT\batfile\shell\print
HKEY_CLASSES_ROOT\batfile\shell\print\command
HKEY_CLASSES_ROOT\batfile\shellex
HKEY_CLASSES_ROOT\batfile\shellex\DropHandler
HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers
HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers\PifProps
HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers\ShimLayer Property
Page
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
In news:79F379B0-1EF8-458A-8F14-EE8138E372DE@microsoft.com,
CHENRYD <CHENRYD@discussions.microsoft.com> hunted and pecked:
- Posted by CHENRYD on February 17th, 2006
Unfortunately, my HKEY_CLASSES_ROOT\batfile tree looks exactly like what you
listed, and there isn't any 'ContextMenuHandlers' subkey under shellex or
anywhere.
"Wesley Vogel" wrote:
- Posted by Ramesh, MS-MVP on February 18th, 2006
Hi Chenryd,
Can you post the .BAT file report here?
See: FileExtInfo
http://windowsxp.mvps.org/fileextinfo.htm
--
Regards,
Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com
"CHENRYD" <CHENRYD@discussions.microsoft.com> wrote in message
news:0D5D7AA2-7DA2-4262-B1F0-9F58DA52B534@microsoft.com...
Unfortunately, my HKEY_CLASSES_ROOT\batfile tree looks exactly like what you
listed, and there isn't any 'ContextMenuHandlers' subkey under shellex or
anywhere.
"Wesley Vogel" wrote:
- Posted by frodo@theshire.org on February 18th, 2006
normal default value is blank, which defaults the double-click to
perform the Open command; you can change this to "Edit" so the default
double click action is Edit instead (a good saftey measure).
default value should be:
%SystemRoot%\System32\NOTEPAD.EXE %1
- Posted by Ramesh, MS-MVP on February 19th, 2006
Wesley's REG fix would have taken care of that setting. Hence I requested
the association report for .BAT file.
--
Regards,
Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com
<frodo@theshire.org> wrote in message
news:11veh0oigqkuv9e@corp.supernews.com...
normal default value is blank, which defaults the double-click to
perform the Open command; you can change this to "Edit" so the default
double click action is Edit instead (a good saftey measure).
default value should be:
%SystemRoot%\System32\NOTEPAD.EXE %1
- Posted by Wesley Vogel on February 20th, 2006
Hi Ramesh,
I have been using FileExtInfo.exe instead of F3ing through the registry,
since 10 September, 2005.
Thanks. ;-)
FileExtInfo - View the association settings for a file type easily
http://windowsxp.mvps.org/fileextinfo.htm
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
In news:ul%23lMKRNGHA.3728@tk2msftngp13.phx.gbl,
Ramesh, MS-MVP <ramesh@XOX.mvps.org> hunted and pecked:
- Posted by Ramesh, MS-MVP on February 21st, 2006
Thanks Wes. I've also got the following feature request recently:
"For example if I want to export a hundred extension I have to save them one
by one in the notepad. It would be a LOT better if the program had an option
to export all of the selected extensions' reg-file. Please put this feature
to the next version."
--
Regards,
Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com
"Wesley Vogel" <123WVogel955@comcast.net> wrote in message
news:%23qydu7jNGHA.1460@TK2MSFTNGP10.phx.gbl...
Hi Ramesh,
I have been using FileExtInfo.exe instead of F3ing through the registry,
since 10 September, 2005.
Thanks. ;-)
FileExtInfo - View the association settings for a file type easily
http://windowsxp.mvps.org/fileextinfo.htm
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
- Posted by Wesley Vogel on February 21st, 2006
A hundred extensions, huh? And they probably want to do that *one* time.
LOL
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
In news:uUnTHfpNGHA.984@tk2msftngp13.phx.gbl,
Ramesh, MS-MVP <ramesh@XOX.mvps.org> hunted and pecked:
- Posted by CHENRYD on March 6th, 2006
I apologize for being so long in replying - other pressing matters. Anyway,
the report - thanks for your help with this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
FileExtInfo v1.0 - Log file
3/6/2006 8:24:31 AM
Complete File association information for ---> .BAT
Useful for troubleshooting File association and other problems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
[HKEY_CLASSES_ROOT\.BAT]
@="batfile"
[HKEY_CLASSES_ROOT\.BAT\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\batfile]
@="MS-DOS Batch File"
"EditFlags"=hex:30,04,00,00
[HKEY_CLASSES_ROOT\batfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 ,32,00,5c,00,73,00,68,00,\
65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c ,00,2c,00,2d,00,31,00,35,\
00,33,00,00,00
[HKEY_CLASSES_ROOT\batfile\shell]
[HKEY_CLASSES_ROOT\batfile\shell\edit]
[HKEY_CLASSES_ROOT\batfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 ,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45 ,00,20,00,25,00,31,00,00,\
00
[HKEY_CLASSES_ROOT\batfile\shell\open]
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\batfile\shell\open\command]
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\batfile\shell\print]
[HKEY_CLASSES_ROOT\batfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 ,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45 ,00,20,00,2f,00,70,00,20,\
00,25,00,31,00,00,00
[HKEY_CLASSES_ROOT\batfile\shellex]
[HKEY_CLASSES_ROOT\batfile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"
[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers]
[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"
[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHan dlers\ShimLayer Property
Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"
"Ramesh, MS-MVP" wrote:
- Posted by Ramesh, MS-MVP on March 6th, 2006
The associations look fine. This problem is most probably caused bya a
context menu extension. Use the following method (trimmed version of David
Candy's posting) to troubleshoot.
Type Regedit in Start Run
Goto
HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\Con textMenuHandlers
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
Export both the keys (on the File Menu) to a safe location (This is your
backup file.)
Delete the two branches and see what happens.
Alternately:
See Method 2 in this link (Ignore the article title)
http://windowsxp.mvps.org/slowrightclick.htm
--
Regards,
Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com
"CHENRYD" <CHENRYD@discussions.microsoft.com> wrote in message
news:B5DA9BD2-D2BA-48E9-84DF-07A11DF98426@microsoft.com...
I apologize for being so long in replying - other pressing matters. Anyway,
the report - thanks for your help with this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
FileExtInfo v1.0 - Log file
3/6/2006 8:24:31 AM
Complete File association information for ---> .BAT
Useful for troubleshooting File association and other problems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
[HKEY_CLASSES_ROOT\.BAT]
@="batfile"
[HKEY_CLASSES_ROOT\.BAT\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\batfile]
@="MS-DOS Batch File"
"EditFlags"=hex:30,04,00,00
[HKEY_CLASSES_ROOT\batfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 ,32,00,5c,00,73,00,68,00,\
65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c ,00,2c,00,2d,00,31,00,35,\
00,33,00,00,00
[HKEY_CLASSES_ROOT\batfile\shell]
[HKEY_CLASSES_ROOT\batfile\shell\edit]
[HKEY_CLASSES_ROOT\batfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00 ,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00 ,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45 ,00,20,00,25,00,31,00,00,\
00
[HKEY_CLASSES_ROOT\batfile\shell\open]
"EditFlags"=hex:00,00,00,00
[HKEY_CLASSES_ROOT\batfile\shell\open\command]
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\batfile\shell\print]
- Posted by CHENRYD on March 6th, 2006
Ramesh -
I tried both methods you suggested here and neither solved the problem, the
right-click menu edit selection on a batch file still tries to run the batch
file. I did notice, however that in ShellExView, when I disabled the Trend
Micro OfficeScan NT extension, it wouldn't stay disabled when I rebooted.
Could this all be something caused by this program? Also, could there be a
system policy set by the domain administrators that would cause this
behavior? This computer is part of a large domain on which I have only local
administrative permissions.
In case it tells you anything, I include the details from the OfficeScan NT
HTML Report.
Extension Name OfficeScan NT
Disabled No
Type Context Menu
Description Shell Extension DLL
Version
Product Name Trend Micro OfficeScan
Company Trend Micro Inc.
My Computer No
Desktop No
Control Panel No
Filename C:\Program Files\Trend Micro\OfficeScan
Client\tmdshell.dll
CLSID {AF4F7471-FCFB-11d0-80B6-0080C838D5F9}
File Created Time 2/16/2005 9:16
CLSID Modified Time 2/14/2006 17:02
Microsoft No
File Extensions *, Directory, Drive
File Attributes A
File Size 86,099
Thanks for your help!
"Ramesh, MS-MVP" wrote:
- Posted by Ramesh, MS-MVP on March 7th, 2006
Beats me, chenryd. Have you tried deleting these two keys (after backing
them up)?
HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\Con textMenuHandlers
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers
Apart from that I don't have an idea why this is happening.
--
Regards,
Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com
"CHENRYD" <CHENRYD@discussions.microsoft.com> wrote in message
news:FB052433-AFF5-4DF6-926B-B02B49BB9E15@microsoft.com...
Ramesh -
I tried both methods you suggested here and neither solved the problem, the
right-click menu edit selection on a batch file still tries to run the batch
file. I did notice, however that in ShellExView, when I disabled the Trend
Micro OfficeScan NT extension, it wouldn't stay disabled when I rebooted.
Could this all be something caused by this program? Also, could there be a
system policy set by the domain administrators that would cause this
behavior? This computer is part of a large domain on which I have only
local
administrative permissions.
In case it tells you anything, I include the details from the OfficeScan NT
HTML Report.
Extension Name OfficeScan NT
Disabled No
Type Context Menu
Description Shell Extension DLL
Version
Product Name Trend Micro OfficeScan
Company Trend Micro Inc.
My Computer No
Desktop No
Control Panel No
Filename C:\Program Files\Trend Micro\OfficeScan
Client\tmdshell.dll
CLSID {AF4F7471-FCFB-11d0-80B6-0080C838D5F9}
File Created Time 2/16/2005 9:16
CLSID Modified Time 2/14/2006 17:02
Microsoft No
File Extensions *, Directory, Drive
File Attributes A
File Size 86,099
Thanks for your help!
- Posted by CHENRYD on March 17th, 2006
I tried those first back at the beginning. I'm pretty convinced that this is
either some sort of policy being enforced by the Domain administrator, or
something created by this Trend Micro OfficeScan that they installed in the
night. Just have to work around it. Thanks for all your efforts, though!
Chip Damsel
"Ramesh, MS-MVP" wrote: