.BAT File Association Broken

G

Guest

I tried to select WordPad instead of Notepad to edit .BAT files.
Somehow I screwed up.
Now .BAT files do not work. When I double-click on them, I just see the
contents of the .BAT file displayed by Notepad.
How can I restore the original functionality?
Thanks for your help.
Henry
 
D

Dave Patrick

From a command prompt;
assoc .bat
should return with
..bat=batfile
If not
assoc .bat=batfile
to restore the default file type association.

ftype batfile
should return with
batfile="%1" %*
If not
ftype batfile="%1" %*
to restore the default "Open" action for the file type.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I tried to select WordPad instead of Notepad to edit .BAT files.
| Somehow I screwed up.
| Now .BAT files do not work. When I double-click on them, I just see the
| contents of the .BAT file displayed by Notepad.
| How can I restore the original functionality?
| Thanks for your help.
| Henry
 
G

Guest

Dave,
Thanks for your reply.

I did everything you said to do & the results are exactly the same as you
showed.
I guess there is something else going on.
When I click on a .BAT file, Notepad just displays the contents of the .BAT
file and the .BAT file is not executed.
Any other ideas?
Henry
 
D

Dave Patrick

Run regedit.exe and navigate to;

HKLM\SOFTWARE\Classes\batfile\shell\open\command
make sure the Reg_Sz
(default)
value data is exactly;
"%1" %*

HKLM\SOFTWARE\Classes\batfile\shell\edit\command
make sure the Reg_Expand_Sz
(default)
value data is exactly;
%SystemRoot%\System32\NOTEPAD.EXE %1


Also look for the key;
..BAT
under
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
and delete the key named
..BAT

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Dave,
| Thanks for your reply.
|
| I did everything you said to do & the results are exactly the same as you
| showed.
| I guess there is something else going on.
| When I click on a .BAT file, Notepad just displays the contents of the
..BAT
| file and the .BAT file is not executed.
| Any other ideas?
| Henry
 
G

Guest

Dave,

You are a GENIUS!

The first 2 items were exactly as you specfied. But when I deleted the .BAT
in the HKCU area, it fixed the problem. Now my .BAT files execute correctly.

Thank you, thank you, thank you
Henry
 
D

Dave Patrick

Good to hear. You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Dave,
|
| You are a GENIUS!
|
| The first 2 items were exactly as you specfied. But when I deleted the
..BAT
| in the HKCU area, it fixed the problem. Now my .BAT files execute
correctly.
|
| Thank you, thank you, thank you
| Henry
 
C

cquirke (MVP Windows shell/user)

On Mon, 4 Sep 2006 11:23:01 -0700, Henry
Dave, You are a GENIUS!
The first 2 items were exactly as you specfied. But when I deleted the .BAT
in the HKCU area, it fixed the problem. Now my .BAT files execute correctly.

The background to this is that XP now allows per-account overrides for
file associations, so HKCR is no longer a simple alias pointing to
HKLM...Classes. In your case, there was an override in HK(C)U.


------------ ----- --- -- - - - -
Drugs are usually safe. Inject? (Y/n)
 

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