Sign in to follow this  
Followers 0
Solomon

Write Variable To .ini

3 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

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  
Followers 0