ron Posted June 29, 2004 Share Posted June 29, 2004 I need to find a file called notes.ini and append a line to the end of it. What would be the best way to do this if possible? The location could be different on every machine and the OS versions are 98 to XP....Help Thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2004 Developers Share Posted June 29, 2004 What about checking Lotus.ini for the path to Notes: [Lotus Applications] Notes=c:\lotus\notesI believe that this directory contains to Notes.ini... right ? If so, a regread and filewriteline could do the trick ..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ron Posted June 29, 2004 Author Share Posted June 29, 2004 Not all of our users will have the notes.ini installed in the same directory. Is it possible to use Regread to search the registry for the old Notes 5 keys and then reference that to find the notes.ini file? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2004 Developers Share Posted June 29, 2004 Yes, you could also do a regread for key HKLM\SOFTWARE\Lotus\Notes keywork:Path SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
emmanuel Posted June 29, 2004 Share Posted June 29, 2004 there's also a plethora of file find UDF's in scripts and scraps, you could use one of those to get the locations of all the notes.ini's on the hd, and then do a for next loop to edit them all? "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
ron Posted June 29, 2004 Author Share Posted June 29, 2004 I was looking through the scripts and scraps, many of those focused on a particular directory. Any tips on how to search all local drives for this file? Link to comment Share on other sites More sharing options...
emmanuel Posted June 29, 2004 Share Posted June 29, 2004 search for drive in the helpfile, I'd say a for next loop based on $localdrives = DriveGetDrive("FIXED") "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
emmanuel Posted June 29, 2004 Share Posted June 29, 2004 wouldn't it be easier to just read the registry for the directory that notes installed into and modify that file? I don't use notes here, so I can't get more detailed, but just do like JdeB suggests... I'm sure it'd be faster than searching all the drives for the notes.ini. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
SlimShady Posted June 29, 2004 Share Posted June 29, 2004 (edited) Not all of our users will have the notes.ini installed in the same directory. Is it possible to use Regread to search the registry for the old Notes 5 keys and then reference that to find the notes.ini file?This man wants to know how to search through the registry... Edited June 29, 2004 by SlimShady Link to comment Share on other sites More sharing options...
emmanuel Posted June 29, 2004 Share Posted June 29, 2004 This man wants to know how to search through the registry... thanks for pointing that out! if you know what the names of the keys are in the registry, you could have it check each of those locations with simple if then work... I don't know there's a way for autoit to literally search the whole registry... though someone could probably figure it out with the new(ish) RegEnumVal and RegEnumKey functions in the unstable build.personally, I'd get the reg keys that I know exist, and get that info, check the info with a fileexists, then if that fails check the next possible reg key... that would likely be faster than searching the whole drive... I doubt that you'd have to check more than a few reg keys before finding the right one, and if you have a sample machine of each different notes install... that'd be your source for those keys... "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
ron Posted July 7, 2004 Author Share Posted July 7, 2004 (edited) This is basically what I have come up with so far, since I am new it's a little rough. I am looking for the specific regkey below then if I find it I use that to find the notes.ini which I would like to append a value to. Once I append that value I want to launch a setup.exe file, which installs the Lotus notes client.... If the regkey specidied in the begining isn't found I want it to end with maybe a text pop-up saying contect the help desk. Any refinments or suggestions please? $NotesReg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\5.0", "Path") If $NotesReg = "Path" then; IniWrite("notes.ini", "[Notes]", "IM_NO_SETUP", "1") elseif $NotesReg = "null" then; goto EndIf Else = FileInstall("G:\ND6\ND65\ND65Client(all)\setup.exe") EndIf Edited July 7, 2004 by ron Link to comment Share on other sites More sharing options...
Developers Jos Posted July 7, 2004 Developers Share Posted July 7, 2004 (edited) I guess you didn't run it yet .... Here's a script to get you started... $NotesReg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\5.0", "Path") if @error then msgbox(16,'Error', "call helpdesk ... Registry key not found ") Exit EndIf If FileExists($NotesReg & "\notes.ini") then IniWrite($NotesReg & "notes.ini", "[Notes]", "IM_NO_SETUP", "1") RunWait("G:\ND6\ND65\ND65Client(all)\setup.exe") ; run the setup from the G: drive Else msgbox(16,'Error', "call helpdesk .... Notes,ini not found") EndIf EDIT some code errors Edited July 7, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ron Posted July 7, 2004 Author Share Posted July 7, 2004 Thanks, I will give it a try. Link to comment Share on other sites More sharing options...
emmanuel Posted July 7, 2004 Share Posted July 7, 2004 I guess you didn't run it yet .... Here's a script to get you started... $NotesReg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes\5.0", "Path") if @error then msgbox(16,'Error', "call helpdesk ... Registry key not found ") Exit EndIf If FileExists($NotesReg & "\notes.ini") then IniWrite($NotesReg & "notes.ini", "[Notes]", "IM_NO_SETUP", "1") RunWait("G:\ND6\ND65\ND65Client(all)\setup.exe"); run the setup from the G: drive Else msgbox(16,'Error', "call helpdesk .... Notes,ini not found") EndIf EDIT some code errorsjust noticed a little fix that's needed: IniWrite($NotesReg & "\notes.ini" "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
ron Posted July 9, 2004 Author Share Posted July 9, 2004 Thanks for everyones help the script is working great. 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