Reading from an ini file to automate logon.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
walgett
Newbie
Posts: 3
Joined: Mon Aug 29, 2005 2:47 am

Reading from an ini file to automate logon.

Post by walgett » Mon Aug 29, 2005 3:05 am

Hi, I need to read a username, password, and an "application type" ( just a number) from an ini file. How do I set up the inifile? I can't get my script to read from a file i create in notepad and save as an *.ini file.
The script needs to send the user name and password to the application whenever the login window is opened by a piece of connected equipment

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Aug 29, 2005 4:21 am

No time for details right now, but you want to use EditIniFile> command.

Check the Help section for EditIniFile. This will create the file for you if it does not exist. Seach the forum for EditIniFile, ReadIniFile and I am sure you will find samples of creating names and passwords.
Last edited by Bob Hansen on Tue Aug 30, 2005 2:58 am, edited 2 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Aug 29, 2005 7:00 am

If you want to read from an Ini file use ReadIniFile and create the ini file to look something like this:

[data]
username=theusername
password=thepassword
apptype=2

Then to read this in:

ReadIniFile>c:\..\inifile.ini,data,username,username
ReadIniFile>c:\..\inifile.ini,data,password,password
ReadIniFile>c:\..\inifile.ini,data,apptype,apptype

The data is now in variables username, password and apptype.
MJT Net Support
[email protected]

walgett
Newbie
Posts: 3
Joined: Mon Aug 29, 2005 2:47 am

Post by walgett » Mon Aug 29, 2005 8:27 am

Thanks everyone for your help, I got it working, main problem was incorrect path to the ini file.... how embarassing

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts