Jump to content
Sign in to follow this  
Solomon

Write Variable To .ini

Recommended Posts

Solomon

Im trying to get the input from a user, in an InputBox, into an .ini file.

$directory = InputBox("Select Directory", "Please type in the directory you wish to use.")
IniWrite("C:\test.ini", "test", "aaa", "$directory")

As it is, its writing $directory into the .ini file. :) I need it to be an .ini file, because the inputted directory will change frequently, and Id rather have the script self contained. Im also going to need the script to look at the .ini file, to find out where the directory is, but I assume that

$var = IniRead("C:\test.ini", "test", "aaa", "[name of dir]")

will provide me with the variable I need?

Edited by Solomon

Share this post


Link to post
Share on other sites
Joon

IniWrite("C:\test.ini", "test", "aaa", $directory)

Remove double quote for $directory.

$var = IniRead("C:\test.ini", "test", "aaa", "default directory")
Edited by Joon

Share this post


Link to post
Share on other sites
Solomon

Why is it so simple when someone else says it, yet so difficult for me to see on my own? :)

Thanks, Joon!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.