WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

FileMenu

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get file extension association

 Keywords: file extension association associated application 

Question:

From the filemenu I would like to click on a file and find out what application is associated with that files, file Extension.

Answer:

Add the Following to your 'filemenu for all filetypes.mnw'
E&xtension
	filename = CurrentFile()
	ext = FileExtension(filename)
	errormode(@off)
	locate= RegQueryValue(@REGCLASSES, strcat(".",ext))
	errormode(@Cancel)
	if lasterror()==1452 ;unable to locate sub key
		message(strcat(StrUpper(ext)," is associated with"),"NOTHING")
	   exit
	endif
	app = RegQueryValue(@REGCLASSES,strcat(locate,"\shell\open\command"))
	message(strcat(StrUpper(ext)," is associated with"),app)

Article ID:   W14850
File Created: 2001:11:08:12:40:24
Last Updated: 2001:11:08:12:40:24