Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: MS Server 2003 Problem - bat file association

30 May 2012   #1

Win7 64bit Home Premium
MS Server 2003 Problem - bat file association

I rebuilt a dell 1855 server with MS 2003sp2. During configurations I accidently associated bat file extentions to notepad and can not run bat files. Any assistance is really appreciated.

Thanks ahead of time.
My System SpecsSystem Spec
31 May 2012   #2

Windows 7 Ultimate 64-Bit SP1

Hey Hawaiian,

I think I can lend a hand here. To change file type associations in Win2K3:

-Right-click on any file and select Open With....
-Or, right-click on any file, select Properties, and then click Change.

Both of these should allow you to change default associations.

If these don't work for you let me know and I'll see what else I can dig up.
My System SpecsSystem Spec
31 May 2012   #3

Windows 2000 5.0 Build 2195

Would this work?

Windows Registry Editor Version 5.00
@="MS-DOS Batch File"
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\ShimLayer Property Page]
HKCU Portion, just in case MSServer2003 has it
Windows Registry Editor Version 5.00

Attached Files
File Type: reg batch_file_assoc.reg (3.6 KB, 128 views)
File Type: reg HKCU.reg (706 Bytes, 123 views)
My System SpecsSystem Spec

03 Jun 2012   #4

Win7 64bit Home Premium

Thanks V43L1N and Arkhi !!! The registry files are the ticket!

I will backup the registry tomorrow at work and run the two reg files. I'm guessing I need to run batch file assoc first then the HCHU reg file.?.

Not ashamed to say I am new to this and really do appreciate all your help. This is the first server I ever rebuilt from scratch. Built one head guess and brain drain at a time. I had to replace both Raid 1 HDD's which meant it was actually a total rebuild from scratch. Worse was I had never setup a Raid drive. It was kool but a lot of head scratching and several pots of coffee and 5-Hour energy bottles.

All was good until I started doing the server lock-downs from a different server built document. Which told me to associate the .bat extension to notepad.exe. After that when i entered a bat file to execute it would only open it in notepad (duh me - thats what i had changed it too and thats when I realized I screwed the pooch).

When I searched the registry there was no .bat or batfile entries. That meant no way to know for sure what to put in the file associations fields to (re-)associate how the entry's were run when the bat file was run from the command prompt.. i.e. what program(s) open/run a batch file command.

What I have managed to do to date is - Currently I can run the bat file but all it does is bring up the command prompt. Then I have to retype the command at the command prompt instead of it running as it should the first time it was input in the Run command.
My System SpecsSystem Spec
04 Jun 2012   #5

Windows 7 Ultimate 64-Bit SP1

That is strange, so the command prompt is not running the batch files, It just opens a command prompt and waits for input?

Have you used the batch file on other systems successfully? It sounds like the batch file you are using is a little off. If you have, I am out of ideas.

I will ask some of the senior members to take a look at this thread when you reply.
My System SpecsSystem Spec
04 Jun 2012   #6

Win7 64bit Home Premium

The batch runs normally on other systems.

Since I had to unassociate the .bat extenstion it wiped all the fields. It also wiped out the registrys entries for "batfile". I am hoping that running your reg file and HKCU keys should reset everything back to normal. ? .

The command to run the "run" is "%1" %* that much I do know. The "runs with application" field was changed when it was "unassociated" and that is what calls and executes the run command. I don't know what to put in there. Just the command it call to "run" is what I dont know. And of course the other commands for "edit" and "print".
My System SpecsSystem Spec
04 Jun 2012   #7

Windows 2000 5.0 Build 2195

Okay, let's be sure here. Run the regedit file below FIRST. This removes bat file entries so you can start with new ones. After you do that, run the two reg files I have above. It doesn't matter what order. Restart computer and let us know.


Windows Registry Editor Version 5.00

Attached Files
File Type: reg removebat.reg (182 Bytes, 122 views)
My System SpecsSystem Spec
06 Jun 2012   #8

Win7 64bit Home Premium

It Worked!! Thanks bunches!!

You're Awesome !!
My System SpecsSystem Spec

Thread Tools

Similar help and support threads
Thread Forum
Change DOC file association back to Word 2003, after Word 2016 install
Hello everyone Until yesterday, I had only Word 2003 and Word 2010 on my computer. When I double-clicked a DOC file, it would open it in Word 2003. When I double-clicked a DOCX file, it would attempt to open it in Word 2010. I could open a DOCX file in Word 2003 if I first ran Word 2003 by...
Microsoft Office
PBK file association problem
Hello. After activating my windows 7 professional 64 bit, pbk files (vpn) are not recognized. Then I found a reg file on the Internet to fix and after running that not only problem not fixed but lnk (shortcut files) association changed to adobe reader. Then I unassociated lnk files using a tool...
General Discussion
.txt file association problem
hi guys:D i am having problem associating txt files to notepad by default my txt files are associated to wscript (found in system32) when i right click and choose notepad it opens alright but not by default when i use choose default prog. the option "always use selected prog..." is greyed...
General Discussion
File association problem
My pdf file was originally associated with Foxit Reader. For some unknown reason, it's stubbornly opened with windows media center, and cannot be changed. I tried editing this in Control panel, but it didn't work. Then, I installed Adobe reader 8.0, and after several rebootings of the machine, it...
General Discussion
Server 2003 TCP/IP problem
I keep getting "Configure TCP/IP. The wizard has detected that there are no valid IP addresses assigned to any of the network adapters for this computer. Please verifiy that the networks cable is connected, and that a DHCP server is available or the computer is configured to use a static IP...
Chillout Room

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 23:03.
Twitter Facebook Google+