WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Numbers

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

UDF - Unicode to ASCII Converter

Keywords:   UDF - Unicode to ASCII Converter 

#DefineFunction ConvertToAscii(f)
fs=FileSize(f)
bb=BinaryAlloc(fs)
BinaryRead(bb,f)
;is it unicode
If (BinaryPeek(bb,0)==255) && (BinaryPeek(bb,1)==254); its unicode, convert
   BinaryEODSet(bb,0)
   BinaryReadEx(bb,0,f,2,-1)
   BinaryConvert(bb,3,0,0,0)
   BinaryWrite(bb,f)
EndIf
BinaryFree(bb)
Return(1)
#EndFunction


RegKey1="HKEY_CURRENT_USER\Printers"
textfile="C:\temp\Printers.txt"
RunWait("Regedit.exe",'/e %textfile% %RegKey1%')
ConvertToAscii(textfile)
Message(0,0)

Article ID:   W15761
File Created: 2003:05:13:11:29:56
Last Updated: 2003:05:13:11:29:56