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: W13130Filename: Associate Extension to Run Winbatch File.txt