@GOTO :Batch a 0100 MOV AH, 09 MOV DX, 0000 INT 21 RET DB "ÿþ$" a 102 MOV DX, 108 u 0100 n C:\UNIHD.COM r BX 0 r CX B w q :Batch @ECHO OFF :: Requires 32-bit "CMD based" Windows IF NOT "%OS%"=="Windows_NT" GOTO Syntax :: ASCII file must be specified and must exist IF "%~1"=="" GOTO Syntax IF NOT EXIST "%~1" GOTO Syntax :: Won't work on 64-bit Windows IF NOT "%ProgramFiles(x86)%"=="" GOTO Syntax SETLOCAL SET ASCIIFile=%~1 IF "%~2"=="" (SET UnicodeFile=%~n1_Unicode.%~x1) ELSE (SET UnicodeFile=%~2) :: Use the "embedded" DEBUG script to create the 11 byte UNIHD.COM DEBUG < %~sf0 :: DEBUG script code based on an article by "JustBurn": :: http://www.instructables.com/id/How-to-write-the-world-s-smallest-%22Hello-World!%22-e/ :: Feel free to customize the path where UNIHD.COM will be :: stored (line 14: "n C:\UNIHD.COM"). :: Warning: Since this batch file uses DEBUG, it will work :: only in 32-bit Windows versions, not in 64-bit versions! :: Redirect UNIHD.COM's output to write the 0xFF and 0xFE :: characters to the target file C:\unihd.com > "%UnicodeFile%" :: ASCII to Unicode conversion with CMD /U /C (after first :: creating a 2-byte header containing character 0xFF and :: 0xFE) as discovered by Jacques Bensimon. CMD.EXE /U /C TYPE "%ASCIIFile%" >> "%UnicodeFile%" ENDLOCAL GOTO:EOF :Syntax ECHO. ECHO ASCII2Uc.bat, Version 1.00 for 32-bit Windows ECHO Converts an ASCII text file to valid Unicode ECHO. ECHO Usage: ASCII2UC ascii_file [ unicode_file ] ECHO. ECHO Where: ascii_file (mandatory) name of the ASCII source file ECHO unicode_file (optional) name of the Unicode target file (default: ECHO the name of the source file with "_Unicode" appended) ECHO. ECHO Notes: ECHO [1] ASCII to Unicode conversion command and header by Jacques Bensimon. ECHO [2] Since the Unicode file header is created using DEBUG, this batch file ECHO won't work in 64-bit Windows versions. ECHO [3] Path of temporary .COM file is hard coded in the "embedded" DEBUG script. ECHO [4] DEBUG script code based on an article by "JustBurn": ECHO www.instructables.com/id/How-to-write-the-world-s-smallest-"Hello-World!"-e/ ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com