Sp0iLedBrAt Posted February 15, 2010 Share Posted February 15, 2010 I found this example and wrote something according to my needs. However, adding Unicode characters does not seem to work. Anybody know how to do it successfully?Thanks Link to comment Share on other sites More sharing options...
jaclaz Posted February 15, 2010 Share Posted February 15, 2010 I don't understand the question.It should actually have a .cmd extension, and it is so short one can post it in a codebox without problems:@echo offclsTITLE:echo 1) Mozilla Firefoxecho 2) Internet Explorer 8echo 3) Media Player Classicecho 4) EXIT:aset /p ans=Enter a number:if '%ans%'== '1' GOTO oneif '%ans%'== '2' GOTO twoif '%ans%'== '3' GOTO threeif '%ans%'== '4' GOTO fourGOTO a:onecd "C:\Program Files\Mozilla Firefox"start firefox.exeGOTO a:twocd "C:\Program Files\Internet Explorer"start iexplore.exeGOTO a:threecd "C:\Program Files\K-Lite Codec Pack\Media Player Classic"start mplayerc.exeGOTO a:fourexitCan you try beetter explaining the problem (apart the fact that "TITLE:" is hardly a batch command)?jaclaz Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted February 15, 2010 Author Share Posted February 15, 2010 (edited) The thing is I want to include Cyrillic characters for explanations, which prompts to save it as Unicode. When started in Unicode, it won't work, and if I ignore the prompt and save it in ASCII with Cyrillic characters, they're shown as question marks. So, you're saying that if I save it in Unicode as a .cmd file, it will work?To answer my own question, it doesn't. Edited February 15, 2010 by Sp0iLedBrAt Link to comment Share on other sites More sharing options...
jaclaz Posted February 15, 2010 Share Posted February 15, 2010 The thing is I want to include Cyrillic characters for explanations, which prompts to save it as Unicode. When started in Unicode, it won't work, and if I ignore the prompt and save it in ASCII with Cyrillic characters, they're shown as question marks. So, you're saying that if I save it in Unicode as a .cmd file, it will work?No, I am saying that I did not understand your question, and that the file you posted contains no UNICODE characters, nor Cyrillic ones.Can you post an example (a short Cyrillic name/word)?Read this in the meantime:http://www.chem.msu.su/soft/convert/readme.txtGet the file:http://www.chem.msu.su/soft/convert/and play with it a bit.are you using (CP866) or (CP1251)?Open a command prompt, type in it EDIT [ENTER]and use the "DOS" editor to create/modify the batch.jaclaz Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted February 15, 2010 Author Share Posted February 15, 2010 (edited) @echo offclsОДБЕРИ ПРОГРАМА ИЛИ ЗАВРШИ:echo 1) Mozilla Firefoxecho 2) Internet Explorer 8echo 3) Media Player Classicecho 4) ЗАВРШИ:aset /p ans=Enter a number:if '%ans%'== '1' GOTO oneif '%ans%'== '2' GOTO twoif '%ans%'== '3' GOTO threeif '%ans%'== '4' GOTO fourGOTO a:onecd "C:\Program Files\Mozilla Firefox"start firefox.exeGOTO a:twocd "C:\Program Files\Internet Explorer"start iexplore.exeGOTO a:threecd "C:\Program Files\K-Lite Codec Pack\Media Player Classic"start mplayerc.exeGOTO a:fourexitThis, for example. BTW, I use Notepad to edit batch files, so I'm not really sure about which set I'm using. Edited February 15, 2010 by Sp0iLedBrAt Link to comment Share on other sites More sharing options...
jaclaz Posted February 15, 2010 Share Posted February 15, 2010 You won't like the answer.You need:to have LucidaConsole (or another TTF font, NOT the raster one)to change page to 1251possibly start CMD.EXE with the /U parameter You need to have SEPARATE batch file and Cyrillic text.Example copy and paste this in a Notepad or Wordpad and save as Unicode with name "choices.txt":1 ОДБЕРИ 2 ПРОГРАМА3 ИЛИ4 ЗАВРШИCopy and paste the following in a Notepad or Wordpad and save as "plain" text with name "test.cmd"@ECHO OFFchcp 1251>nulmore choices.txtfor /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "1"') DO ECHO %%Bfor /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "2"') DO ECHO %%Bfor /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "3"') DO ECHO %%Bfor /F "tokens=1,2" %%A IN ('more choices.txt^|FIND "4"') DO ECHO %%Bchcp 437>nulOpen a command prompt, make sure that you are using Lucida Console.Type in it:MORE choices.txt[ENTER]Now run test.cmd:TEST[ENTER]jaclaz Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted February 15, 2010 Author Share Posted February 15, 2010 Thanks, I'll try it and report. Link to comment Share on other sites More sharing options...
mlykvai Posted February 16, 2021 Share Posted February 16, 2021 where to download? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now