Jump to content

IniRead


Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

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