Jump to content

how to use the RUN function to run a msi file !?


Recommended Posts

Guest JohnHood

I'm trying to get the autoit variable $var to replace the info in quotes.

Run( @SystemDir & "\msiexec.exe /I program.msi" )

I need to be able to run three programs in series. Not always the same program, hence the INI.

I tried:

EnvSet("ENVAR", $var)

Run(@COMSPEC " /c Start %ENVAR%")

Basically, I can't figure out how to get @comspec to read an AutoIt variable.

Link to comment
Share on other sites

  • Developers

I'm trying to get the autoit variable $var to replace the info in quotes.

Run( @SystemDir & "\msiexec.exe /I program.msi" )

I need to be able to run three programs in series.  Not always the same program, hence the INI. 

I tried:

EnvSet("ENVAR", $var)

Run(@COMSPEC " /c Start %ENVAR%")

Basically, I can't figure out how to get @comspec to  read an AutoIt variable.

; EnvSet("ENVAR", $var) don't think you need this..
Run(@COMSPEC " /c Start " & ENVAR)
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

To read a Key/Value in an INI file, you can use the "IniRead()" function (check the doc). Here's a code snippet:

$var = IniRead("C:\myfile.ini", "section2", "key")

; Use "&" to concatenate strings
Run(@ComSpec & " /c Start " & $var)

Hope this helps!

=MX=

Link to comment
Share on other sites

Guest johnhood

OK one more and I'll stop bugging you:

Command line is {the name of the script,} {the name of the ini file to read}.

$ini = $CmdLine[1]

It gets this, I can Echo the $ini variable correctly

But:

$var = IniRead("& $ini &", "launch", "1", "NotFound")

Always comes back "not found"

tried this:

$var = IniRead(" & $ini & ", "launch", "1", "NotFound")

and this:

$var = IniRead($ini, "launch", "1", "NotFound")

and this:

$var = IniRead(" & $ini & ", "launch", "1", "NotFound")

What am I doing wrong?

Link to comment
Share on other sites

  • Developers

This is the correct version....

$var = IniRead($ini, "launch", "1", "NotFound")

are you sure that the INI is in the same directory as the default path or are you supplying the whole path to the ini file ??

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...