Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

batch file association

Status
Not open for further replies.

gurner

Technical User
Feb 13, 2002
522
US
anyone know how to restore the batch script run on Vista? (so when you double click it it runs through the script in a command line again)

as for some reason now when i run one it just opens notepad.

i have tried the file association pane in default programs, but dont know which to try, cmd.exe just opens a command line window that does nothing.

cheer

Gurner
 
Have you tried to save the file with a .bat extension? Rename the file "filename.bat". (without the " " of course)

Joey
CCNA, MCP, A+, Network+, Wireless#
 
yeah, they're .bat files that ran the otherday, not ones being saved as test.bat.txt coz the extensions hidden or something.

the execution of the batch script function has stopped, it just opens notepad, even though the extension is .bat

Gurner
 
Assoc .bat=batfile run from a Command Prompt might help?

What have you got at this registry location?

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\open\command]
@="\"%1\" %*"

Have you got something pointing to Notepad.exe? Notepad should only be referenced in the Edit Key.
 
Mmm... theres only a '.bat' that relates to batch files

the only thing in it is one key called 'persistanthandler'

i checked other command line type ones that still run and they are the same, '.cmd' '.com' etc

Gurner
 
found it, those details are there.

i've tried running this below from another copy of vista as a .reg file but it comes back with 'not all data was successfully written to the registry. some keys are open by the system or other processes'

even safe mode shows the same message.
------------------------------------------

Windows Registry Editor Version 5.00

[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}"

--------------------------------

Gurner
 
doing a winmerge of both the .cmd 'cmdfile' key and the .bat 'batfile' keys, they are identical, yet .cmd works and .bat doesnt

Mmm... changing the extensions to .cmd seems to work ok, though it would probably be an idea to get .bat batch scripting to work, ha

Gurner
 
What are the Security Access Permissions to the Registry showing you?

Have you tried an old fashioned System Restore?

Are there Security type programs which may be preventing the running of .bat?
 
it is also possible that previously, you have changed a .bat file, it was backed up as a .bak file, and somehow its atributes were changed. this might have affected your acces to notepad - you could check the situation with your file attributes ... you could also try running the suspect .bat in a good old DOS window on another machine...(just quessing at this point)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top