RSS Feed Link       View page in German   View page in Spanish   View page in French   View page in Italian   View page in Portuguese   View page in Japanese   View page in Korean   View page in Simplified Chinese   Happy Independence Day!
Log On   Feedback   Search Site    
 
 
Home eZine Software Scripting Network Admin. SITE UPGRADE IN PROGRESS - CLICK HERE FOR INFO 
 
Using the RunDLL32 within INF Files
Languages   UDF/UDC Libraries   Data Access   Visual Studio    

 
Dx21s RSS Feed keeps you up to date and your inbox clear

Select Area:

Information
ADSI
ASP
AutoIt
(D)HTML
KiXtart
MS-DOS / CMD
PowerShell
RunDLL32
ScriptIt
VBScript
WMI

RunDLL32 and INF Files
Dx21 Book Recommendations

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

 


Return to the Main Menu

 
Good Morning
7/4/2008 10:35:37 AM
Copyright © 1997 - 2008 Dx21, LLC. All rights reserved.
Dx21, LLC a Washington Limited Liability Company
  Privacy Policy | Terms of Use
   
Labelled with ICRA   Rated with SafeSurf