|
INF Files can be used to install and remove applications, general files, etc. To script an INF file to install or remove, you call the RunDLL32 application from a script using the following syntax:
General Syntax:
| Windows 9x Syntax: |
rundll.exe
setupx.dll,InstallHinfSection {Section} {intMode} {INFFile} |
| Windows NT thru 2003 & XP: |
rundll32.exe setupapi.dll,InstallHinfSection {Section}
{intMode} {INFFile} |
Where:
| INFFile |
Is the path and file name of the INF file to install or
uninstall. Long file names should be in quotes. |
| intMode |
Is a number combined from the number in the below table
describing the action mode. The default is 132. |
| Section |
Any install or uninstall section within the INF file. The
keywords DefaultInstall and
DefaultUninstall are typically used. |
Action Mode Values:
| 0 |
Either System provided INF Or Never reboot the
computer |
| 128 |
Set the default path of the installation to the location of the INF.
This is the typical setting. |
| 1 |
Reboot the computer in all cases. |
| 2 |
Always ask the users if they want to reboot. |
| 3 |
Reboot the computer if necessary without asking user for permission. |
| 4 |
If a reboot of the computer is necessary, ask the user for
permission before rebooting. |
You should use a combination of the above values for the action mode. You must include 128 to set the default path of the installation to the location of the INF, otherwise a system-provided INF is assumed. Add values to specify rebooting. Note that only the values 128 or 132 are recommended, other values may cause the computer to reboot unnecessarily or not reboot when it required.
Example:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 C:\WINDOWS\INF\SHELL.INF
|
|