2010年2月12日 星期五

Rundll32 使用inf 裝 driver

Rundll32 使用inf 裝 driver @ Ces't la vie :: Xuite日誌:

"Rundll32 使用inf 裝 driver


rundll32 呼叫setupapi就可以安裝或是反安裝驅動程式

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 .\setup.inf

rundll32.exe 執行檔

setupapi.dll 動態連結檔

InstallHinfSection function

VOID CALLBACK InstallHinfSection(
__in HWND hwnd,
__in HINSTANCE ModuleHandle,
__in PCTSTR CmdLineBuffer,
__in INT nCmdShow
);

Parameters

hwnd [in]

The parent window handle. Typically hwnd is Null.
ModuleHandle [in]

Reserved and should be Null.
CmdLineBuffer [in]

Pointer to buffer containing the command line. You should use a null-terminated string.
nCmdShow [in]

Reserved and should be zero.

Return Value

This function does not return a value.



數字132

Value Description
0 System provided INF.
128 Set the default path of the installation to the location of the INF. This is the typical setting.
+0 Never reboot the computer.
+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.

.\setup.inf

路徑加上inf檔名

安裝用 DefaultInstall

反安裝用 DefaultUninstall

當然inf需要依照格式編寫

http://msdn.microsoft.com/en-us/library/ms793586.aspx"

沒有留言:

張貼留言