pcjunki Posted May 14, 2014 Share Posted May 14, 2014 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 More sharing options...
Moderators JLogan3o13 Posted May 14, 2014 Moderators Share Posted May 14, 2014 (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 May 14, 2014 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 More sharing options...
pcjunki Posted May 14, 2014 Author Share Posted May 14, 2014 (edited) I'm reading from the root, and writing to the user profile directory Edited May 14, 2014 by pcjunki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 14, 2014 Moderators Share Posted May 14, 2014 Yes, I amended my post, mistyped. "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 More sharing options...
pcjunki Posted May 14, 2014 Author Share Posted May 14, 2014 I see that ..haha yes the directory structure is all there and correct...hmmmm Link to comment Share on other sites More sharing options...
pcjunki Posted May 14, 2014 Author Share Posted May 14, 2014 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 More sharing options...
pcjunki Posted May 14, 2014 Author Share Posted May 14, 2014 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now