.BAT right-click Edit command runs batch file, doesn't open editor

G

Guest

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
 
W

Wesley Vogel

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\ContextMenuHandlers

You should not have that key!

Delete the ContextMenuHandlers key if it exists.

Edit Gone from your Context Menu?
http://www.serverwatch.com/tutorials/article.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\PropertySheetHandlers
HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\PifProps
HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\ShimLayer Property
Page


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
G

Guest

Unfortunately, my HKEY_CLASSES_ROOT\batfile tree looks exactly like what you
listed, and there isn't any 'ContextMenuHandlers' subkey under shellex or
anywhere.
 
F

frodo

HKEY_CLASSES_ROOT\batfile\shell

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).
HKEY_CLASSES_ROOT\batfile\shell\edit
HKEY_CLASSES_ROOT\batfile\shell\edit\command

default value should be:

%SystemRoot%\System32\NOTEPAD.EXE %1
 
R

Ramesh, MS-MVP

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


HKEY_CLASSES_ROOT\batfile\shell

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).
HKEY_CLASSES_ROOT\batfile\shell\edit
HKEY_CLASSES_ROOT\batfile\shell\edit\command

default value should be:

%SystemRoot%\System32\NOTEPAD.EXE %1
 
W

Wesley Vogel

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
Ramesh said:
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


HKEY_CLASSES_ROOT\batfile\shell

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).
HKEY_CLASSES_ROOT\batfile\shell\edit
HKEY_CLASSES_ROOT\batfile\shell\edit\command

default value should be:

%SystemRoot%\System32\NOTEPAD.EXE %1
 
R

Ramesh, MS-MVP

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


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
 
W

Wesley Vogel

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
 
G

Guest

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\PropertySheetHandlers]

[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"

[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\ShimLayer Property
Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"



Ramesh said:
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


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 said:
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)
-----
 
R

Ramesh, MS-MVP

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\ContextMenuHandlers
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


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]
 
G

Guest

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 said:
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\ContextMenuHandlers
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


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]
 
R

Ramesh, MS-MVP

Beats me, chenryd. Have you tried deleting these two keys (after backing
them up)?

HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers
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


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!
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top