Jump to content

jdillig

Members
  • Posts

    7
  • Joined

  • Last visited

jdillig's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I tested using AutoIT to actually write the .ini file and so far it seems to be working. Is there some special formatting that the IniWrite() function uses to write the .ini? This is the exact contents of the new file that was written using the iniwrite() function. The formatting is the same as before for the Section and Key names. [OVF Instructions] OVFDeploy=MyOVF Script [Lab Description] Description=mydescripthere I do appreciate the help from you guys on this! I still don't understand why this didn't work before, if anyone wants to take a crack at explaining why, I would love to understand the root issue.
  2. So this is interesting, the _arraydisplay() only shows 1 of the 2 sections inside the .ini. The one shown however is not the one I called from IniRead(), it finds the "OVF Instructions" only. _arraydisplay() Row|Col 0 [0]|1 [1]|OVF Instructions I don't think that the .ini format is incorrect... Maybe it is?
  3. Same issue. FileExists() finds the file but IniRead() does not.
  4. I added a fileexist() check and it found it ok. Below is the code I used. I tested your method and it did work when the .ini file was in the same directory as the script. Does anyone know if the IniRead() function relies on a .ini file path that does not contain any spaces? The test .ini is only 4 lines (97 bytes) and the full .ini is around 20-30 lines (496 bytes) This is the code I used to test with the suggestions so far. It still does not work when the .ini file is not in the same directory as the script. if FileExists(@ScriptDir & "\labs\R77.20 Standalone\LDConfig.ini") then MsgBox(0,"","It is there") $Lab_LDConfig_Descript = IniRead(@ScriptDir & "\labs\R77.20 Standalone\LDConfig.ini", "Lab Description", "Description", "ERROR") if $Lab_LDConfig_Descript = "ERROR" Then MsgBox(0, "Error!", "Iniread returned ERROR!") Else MsgBox(0, "Success!", "Iniread returned " & $Lab_LDConfig_Descript) EndIf
  5. Melba23, Thanks for the response. I tried this and found no difference. I am expecting the $Lab_LDConfig_Descript variable to contain the string, "This is a lab" as read from the LDConfig.ini file. When I output what $Lab_LDConfig_Descript contains into a msgbox, I still get "0".
  6. Gentlemen, Hopefully you can help me out here. I have been beating my head against a wall for about a week trying to figure this one out before writing this. I have a simple setup where i am storing information inside a .ini file and using the IniRead() function to pull this information. I have done this in the past and not had an issue until now. The $Lab_LDConfig_Descript variable always will equal the "0" default value and i cannot figure out why. I can take the full path (from the root) and past into CMD and it will find and open the .ini so I do not believe it is an issue with the path. I have also tried UTF and ANSI encoding on the file and this did not change anything. Hopefully this is something stupid and simple but I cannot find it! Here is the basic code: $Lab_LDConfig_Descript = IniRead(@ScriptDir&"\labs\R77.20 Standalone\LDConfig.ini","Lab Description","Description",0) if $Lab_LDConfig_Descript = 0 Then MsgBox(0,"Error!","Iniread returned 0!") Else MsgBox(0,"Success!","Iniread returned "&$Lab_LDConfig_Descript) EndIf The LDConfig.ini file contains the following: [Lab Description] Description=This is a lab [OVF Instructions] OVFDeploy=instructions here
×
×
  • Create New...