Jump to content

Using Ini Files


Recommended Posts

Hiya all! Im gonna do my best to explain what I want to do, but I wont get chance to check this again until 3:00PM GMT. Okie dokie, here goes:

In a AutoIt script .exe file I want to put the command, for example:

Sleep(2000)
Send($input1)
Send("{ENTER}")
Sleep(50)
Send($input2)
Exit

Okies, now then, I want $input1 and $input2 to be obtained from a .ini file and I need to know how to obtain these from the ini file(it gets a bit tidious typing the same data into an InputBox everytime). If I aint explained that proper this is what I want:

.INI FILE:

[inputs]
$input1=example1
$input2=example2

.EXE COMMANDS:

Sleep(2000)
Send($input1)         ;Obtained from .ini file
Send("{ENTER}")
Sleep(50)
Send($input2)         ;Obtained from .ini file
Exit

By the way, why do u have to put the [ ] in the ini file thing

Thanks for your help,

Sam

Link to comment
Share on other sites

It is just a standard InI format thing.

If you use the iniwrite functions from the help file, it will create your INI file for you. You can then use the iniread function to read it, and it might be a bit easier to know all the parameters.

;my first ini
IniWrite("C:\Temp\myfile.ini", "section2", "key", "this is a new value")
$var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound")
MsgBox(4096, "Result", $var)
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

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...