Sign in to follow this  
Followers 0
Pangu

script autoit run file.inf

4 posts in this topic

Hello

I would like to launch an installation of a file .inf with a script autoit as on the image with right clic

post-15470-1175532415_thumb.jpg

it's possible ?


"Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois-

Share this post


Link to post
Share on other sites



Hi, i think you need this one:

$InfFile = "Test.inf"

Run(@SystemDir & "\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 " & $InfFile)

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Hi, i think you need this one:

$InfFile = "Test.inf"

Run(@SystemDir & "\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 " & $InfFile)
I try but that did not function :shocked:

"Donne un poisson à un homme, il mangera un jour. Apprends lui à pècher, il mangera toujours."-Proverbe chinois-

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

CODE

Microsoft source page link

Create an Autorun.inf File

Autorun.inf is a text file that is located in the root folder of your application CD-ROM. It provides to the computer the name and the location of the startup program for your application that is installed when the CD-ROM is inserted. The Autorun.inf file can also contain optional information including the following:

⢠The name of a file that contains an icon that represents your application's CD-ROM drive. This icon appears in Windows Explorer instead of the standard drive icon.

⢠Additional commands for the shortcut menu that appears when the user right-clicks the CD-ROM icon. You can also specify the default command that runs when the user double-clicks the icon.

Autorun.inf files are similar to .ini files. They include one or more sections. Each section has a name that is enclosed in square brackets. Each section contains a series of commands that the Windows Shell runs when the user inserts the disc. The following two sections are currently defined for Autorun.inf files:

⢠The [autorun] section contains the default Autorun commands. All Autorun.inf files must have an [autorun] section.

⢠An optional [autorun.alpha] section can be included for Microsoft Windows NT 4.0 systems running on RISC-based computers. When a CD-ROM is inserted in a CD-ROM drive on a RISC-based system, the Windows Shell runs the commands in this section instead of those in the [autorun] section.

Each section contains a series of commands that determine how the Autorun operation occurs. The following five commands are available:

⢠defaulticon: Specifies the default icon for the application.

⢠icon: Specifies the path and the file name of an application-specific icon for the CD-ROM drive.

⢠open: Specifies the path and the file name of the startup application.

⢠shell: Defines the default command in the shortcut menu of the CD-ROM.

⢠shell\verb: Adds commands to the shortcut menu of the CD-ROM.

The following is an example of a simple Autorun.inf file. It specifies Filename.exe as the startup application. The second icon represents the CD-ROM drive instead of the standard drive icon.

IASScript 1.84 may help you customize easier. You can create your file by using certain commands and verbs.

:shocked:

Edit:

Good example and further information at the Autorun Wiki here.

Edited by MHz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0