Sign in to follow this  
Followers 0
pcjunki

IniRead

7 posts in this topic

I'm trying to use the functions of iniread for the first time.

I think I have grasped the idea of how it works, but my code is not working.

this is what I have.....

on my c: drive is my ini

c:file.ini

which contains this code

[data]
file=c:\users\droid\file2.txt

my autoit script contains this...

$file = IniRead ( "c:\file.ini", "data", "file" , ""  )
filewriteline ($file, "user name:" & @UserName & @CRLF)

when I run it, a file called "file2.txt" should be in the user profile, but nothing shows up.

any clues?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It is likely because you're trying to write to the root of C:. Try pointing it to your desktop, should work just fine. You may have to use #RequireAdmin.

 

Edit:

Sorry, I misread your post. It still sounds like a directory issue. Does the directory exist? Your code, pointed at the root of my own profile, works just fine.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'm reading from the root, and writing to the user profile directory

Edited by pcjunki

Share this post


Link to post
Share on other sites

Yes, I amended my post, mistyped.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I see that ..haha

yes the directory structure is all there and correct...hmmmm

Share this post


Link to post
Share on other sites

wait, I'm onto something, on the c: drive, I edit my ini to show this

file=file2.txt

I run my autoit script, which is saved on the desktop, and it creates the file2.txt on the desktop with the correct data in it

I just need to tweak it some

Share this post


Link to post
Share on other sites

I think I know what it was...cause I had my ini in another directory, it "messed" up

now I know to keep the ini and exe in the same directory and i'll be good

learn something new everyday!

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