To create a registry entry, the reg
command is used. How can I use the reg
command to specify a file, for example, of type .test
to automatically open with openTest.exe, and be listed as a Useless Test File
under the file type details?
Try this batch to Associate .test as filetype and default run program to run the .test file.
@echo off
SETLOCAL EnableDelayedExpansion
ASSOC .test=Useless Test File
set myapppath="%homedrive%\MyTestProgram\"
REG ADD "HKCR\.test\DefaultIcon" /d %myapppath%\openTest.ico
REG ADD "HKCR\.test\shell\Open\command" /d "%myapppath%\openTest.exe %%1"
The above batch will associate ".test" and set its description as "Useless Test File"
myapppath will set your path to your application directory.(edit path as required)
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras