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

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

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

How to Associate Extensions to Run Winbatch Program

Keywords: 	   file associate file associations

Question:

I want to create a winbatch program to associate an extension to run a compiled winbatch EXE, i.e., *.PKZ file will run c:\zap\Ziprun.exe "%1"

I know this can be done with winbatch's registry commands, However I'm not sure where to start.

Answer:

        rkey=RegOpenKey(@REGCLASSES,"")
        if RegExistKey(rkey,".pkz") then RegDeleteKey(rkey,".pkz")
        RegSetValue(rkey, ".pkz", "pkz_auto_file")
        RegSetValue(rkey,"pkz_auto_file\shell\open\command",strcat('"c:\zap\Ziprun.exe" "%%1"'))
        AU=StrUpper(a)
        RegSetValue(rkey,"pkz_auto_file","PKZ File")   ; Or other description
        RegClosekey(rkey)

Article ID:   W13130
Filename:   Associate Extension to Run Winbatch File.txt
File Created: 1999:04:15:16:51:58
Last Updated: 1999:04:15:16:51:58