yan_sheila
asked on
Export registry information into text file
Refer to the question:
https://www.experts-exchange.com/questions/21370972/Auto-export-registry-file.html
When I tried to read the odbc.txt with VBScript, it shows special words.
But if I copy the text file and paste it to a new text file, and the VBScript works.
Why this happens?
https://www.experts-exchange.com/questions/21370972/Auto-export-registry-file.html
When I tried to read the odbc.txt with VBScript, it shows special words.
But if I copy the text file and paste it to a new text file, and the VBScript works.
Why this happens?
That's probably because the file created by regedit is saved in Unicode format; when you copy and paste just the text into a new file, and save this in ANSI format, it works. Try to open the file created in notepad, choose "Save as", and save it in ANSI instead of Unicode. If this works, then you'll have to adjust the file handling in your VBS script.
ASKER
oBdA,
Thanks for your help.
With the answer you suggested last time:
regedit /e odbc.txt "HKEY_LOCAL_MACHINE\SOFTWA RE\ODBC\OD BC.INI"
can the text file be saved in ANSI format automatically?
or is there any way to change the Unicode to ANSI format automatically?
Sheila
Thanks for your help.
With the answer you suggested last time:
regedit /e odbc.txt "HKEY_LOCAL_MACHINE\SOFTWA
can the text file be saved in ANSI format automatically?
or is there any way to change the Unicode to ANSI format automatically?
Sheila
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vamthopentextfile.asp - set the iomode to 1 to read unicode.