When you right click on a .inf file you have an option to ‘Install’. I want to install a .inf file from the command line using a batch file. What is the ‘right’ way to do this?
Thanks!
[edit] I should clarify that I am trying to run this on Windows XP (and not Vista). Though I appriciate (and up-voted) the below answer mentioning InfDefaultInstall.exe, I believe that program was not shipped with XP.
You can find the command when looking at the
HKCR\inffile\shell\Install\commandregistry key. On Windows XP this ison Windows Vista and later this would be
To use the batch file across several Windows versions you would need some trickery. You could use
reg.exeto query for the key and try parsing the output (I didn’t find a quick way of getting only the value fromreg). If you know what platforms you’re running on you could also hard-code the command lines and switch according to the Windows version (which would need another hack to find that out.%OS%doesn’t tell you more than ‘Windows NT’, unfortunately.).