Jump to content

Passing Macros from an INI filie


Recommended Posts

For the code

$installs=IniRead ( "autorun.inf", "AutoRunParams", "installdir", @ScriptDir & "\$OEM$\Install\" )
$wpipath=IniRead ( "autorun.inf", "AutoRunParams", "wpidir", @ScriptDir & "\$OEM$\WPI\" )

And the ini file

[AutoRunParams]
installdir=@ScriptDir & "\install"
wpidir=@ScriptDir & "\WPI"

if it fails it returns the proper string, however if i put macros in the code it doesnt return what i want, is there any way to have it return a variable location?

Link to comment
Share on other sites

doesnt seem to work ;)

Opt("ExpandVarStrings", 1)
$cdrom=@ScriptDir & "\"
$installs=IniRead ( "autorun.inf", "AutoRunParams", "installdir", @ScriptDir & "\$OEM$\Install\" )
$wpipath=IniRead ( "autorun.inf", "AutoRunParams", "wpidir", @ScriptDir & "\$OEM$\WPI\" )

MsgBox(0,"",$wpipath&" "&$installs)

[AutoRunParams]
installdir=@ScriptDir & "\install"
wpidir=@ScriptDir\$OEM$

Posted Image

if this doesnt work is there any way to take a particular string like %cdrom% and have that replaced with the macro @ScriptDir (my script will always be run from the base directory of a cd/dvd

ahh, nm i just chaged it to this in the ini

installdir=@ScriptDir@\$$OEM$$\Install
wpidir=@ScriptDir@\$$OEM$$\WPI
Edited by Swimming_BIrd
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...