hidden hit counter
Help!

.BAT File Association Broken - help 2

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Perform Maintain RSS
Next:  Scheduling Defragmentation  
Author Message
Henry
External


Since: Mar 16, 2006
Posts: 66



PostPosted: Mon Sep 04, 2006 1:28 pm    Post subject: .BAT File Association Broken
Archived from groups: microsoft>public>windowsxp>perform_maintain (more info?)

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
Back to top
Dave Patrick
External


Since: Oct 18, 2005
Posts: 1654



PostPosted: Mon Sep 04, 2006 2:30 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Henry" wrote:
|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
Back to top
Henry
External


Since: Mar 16, 2006
Posts: 66



PostPosted: Mon Sep 04, 2006 2:30 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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


"Dave Patrick" wrote:

> 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
>
> "Henry" wrote:
> |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
>
>
>
Back to top
Dave Patrick
External


Since: Oct 18, 2005
Posts: 1654



PostPosted: Mon Sep 04, 2006 3:36 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Henry" wrote:
| 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
Back to top
Henry
External


Since: Mar 16, 2006
Posts: 66



PostPosted: Mon Sep 04, 2006 3:36 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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


"Dave Patrick" wrote:

> 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
>
> "Henry" wrote:
> | 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
>
>
>
Back to top
Dave Patrick
External


Since: Oct 18, 2005
Posts: 1654



PostPosted: Mon Sep 04, 2006 4:37 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Henry" wrote:
| 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
Back to top
"cquirke
External


Since: Mar 06, 2005
Posts: 825



PostPosted: Sat Sep 09, 2006 9:30 pm    Post subject: Re: .BAT File Association Broken [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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)
>------------ ----- --- -- - - - -
Back to top
mr_z



Joined: Feb 16, 2009
Posts: 1



PostPosted: Mon Feb 16, 2009 3:53 pm    Post subject: [Login to view extended thread Info.]

I had the same problem with Vista.
The step in Dave's reply to do with removing the .bat entry worked for me.
Just a minor difference however. Under Vista it is as follows:
Delete:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Perform Maintain All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum