Jump to content
Sign in to follow this  

Write Variable To .ini

Recommended Posts

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

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...