Jump to content

Recommended Posts

Posted

ok....so is anyone gunna help me AT ALL?or are all these "brainiacs"(not offensive)out there finally stumped...the internet is no help as all the files i try to dl are humungous....

Posted

INI-files can be changed with the IniWrite command. a simple search in the helpfile should show you everything you can do with INI-files.

But the second part...

A file cannot be linked to another file, so your question is what's wrong. Maybe there are some people out there that can read your mind and can help you. But with that little information you provide I doubt that.

Besides just waiting one hour and then complaining that you didn't receive any help is a bit strange. There are parts of the world where it's deep night just now and usually everyone is asleep.

Posted

Depends on the program. Most windows software has a hardcoded path and filename (like windows directory, user directory or current directory) and in most cases you cannot tell the program to read a specific ini-file.

Posted (edited)

yep.. just cause you have an .ini does not mean the program you want to read it.. will read it.

if the program has a .ini already.. you might just try editing it

what exactly are you trying to do?

we are here to help

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Posted

black.. thats obvious if they are both able to use the same .ini

i think he meant use any program... with any .ini

which is just .... plain.... crazy

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Posted

ok...me write script...me compile script to .exe ... me ask u guys for help making .ini file to configure certain things in the .exe "autoit script"...me rephrase question to help u guys understand...and no there obviously isnt a .ini file for the program already...btw this is an .ini file for me conditional statement script...

Thanks,

Dan

Posted

ok...me write script...me compile script to .exe ... me ask u guys for help making .ini file to configure certain things in the .exe "autoit script"...me rephrase question to help u guys understand...and no there obviously isnt a .ini file for the program already...btw this is an .ini file for me conditional statement script...

Thanks,

Dan

<{POST_SNAPBACK}>

IniRead ( "filename", "section", "key", "default" )

config.ini config1 myvar notfound

Contents of config.ini

[config1]

myvar = myvalue

Code to retrieve myvar's value

$readmyini = IniRead ( "config.ini", "config1", "myvar", "notfound" )
msgbox(0,"Value", "The value of myvar is " & $readmyini)

Success: Returns the requested key value.

Failure: Returns the default string if requested key not found.

A standard ini file looks like:

[sectionName]

Key=Value

Code to write value to myvar

$writevalue = InputBox ( "Value", "Enter Value" , "blah" )
IniWrite ( "config.ini", "config1", "myvar", $writevalue )

This is all straight outta the help file with very minor alteration. Have you read it?

Posted

Just to confuse you a bit more, if you want multiple scripts to use the same INI, I normally store the INI location in the registry. You can also have the program read the ini file, and if it fails, you could have it write the default one.

check out RegWrite and RegRead functions in the manual.

I made a few programs for others, and the program would ask them questions on file locations the first time, and then it would store these defaults on the computer, later it would just read these and not have to ask each time. My second script I gave them read the reg entry to determine that INI and knew the file locations. I never had to worry about where they stored anything, and didn't have to use any searches.

AutoIt3, the MACGYVER Pocket Knife for computers.

Posted

@josbe - um...ive read that over and over and over trying to figure out what that means...i want the .ini file to be able to configure only a few things out of the entire script...so that means ...

Posted

IniWrite( "Config.ini", "Settings", "Username", "JoeUser") Would write this to Config.ini

[settings]

Username=JoeUser

To read it you would do

IniRead("Config.ini", "Settings", "Username", "Not Found")

The return value would be JoeUser. And if the key, "Username" didn't exist, it would return "Not Found".

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Posted (edited)

What do you mean. If a .ini looks like this:

[information]

Username=JoeUser

Password=JoePass

and you wanted to change the password, you would do.

IniWrite("Config.ini", "Information", "Password", "JoePass2")

This would:

a.) If the key "Password" doesn't exist, it would write the key in with the value.

b.) If the key "Password" does exist, it would change the value to JoePass2

Edit:

A standard ini file looks like:

[sectionName]Key=Value

Edited by the_lord_mephy
My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

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
  • Recently Browsing   0 members

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