Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble Reading Ini sometimes?

Status
Not open for further replies.

Troy28M

Programmer
Jan 24, 2005
24
US
I have a small vbscript/hta that creates an ini file to be used when running other tools. It contains just minimal information that tells the other programs what type of data should be used/displayed/allowed.

Enough of that, the problem is that on a handful of these created ini files, the data can not be read using FSO. When I push the results to my output or msgbox, I get "ÿ_[" and that is all. This is a 6 line ini file, when I capture the output in another text file I get "?????????".

Does anyone have a clue why this could be happening? Like I said it has only happened on 3 systems that I know about and I am currently using this setup on 2000 systems.
 
Maybe they're opening in the wrong format.


try

objFSO.OpenTextFile("C:\scripts\file.ini", 1, , True) ' open as Unicode

or

objFSO.OpenTextFile("C:\scripts\file.ini", 1, , False) ' open as ASCII

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks DM but I have already tried that, the only thing that I can come up with is that the file is corrupt. Funny thing as I create the file through code, based on user selections, and the 1st time it is called after that it is already corrupt. I attempted to regenerate the file today and the new file works, most of the time. Just doesn't make much sense.

I know it is just a text file but do you think an XML could be more stable than ini, same text file but maybe the DOM will maintain file stability better than FSO...thoughts?
 
Maybe try re-installing WSH on those that are having problems and see if it helps.

As for an XML file, I think it would be a great way to store configuration settings and would be worth a try.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Didn't even think about re-installing WSH, that is worth a try for sure.

I have been writing the XML conversion tonight to test tomorrow, we'll see if that corrects the situation before re-installing.

Thanks for the information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top