Answer the question
In order to leave comments, you need to log in
Strange SendKeys bug on VBS, 3 hours can't find an answer?
According to the logic of things, the script should create a console, change the encoding to Windows-1251, send the English text "KPACUBO" and emulate pressing Enter. But the encoding does not change "The line swears that the file is not found, if I write cmd \ C in front of it, then a completely different console opens and everything changes there, but I need this one." BUT the most important thing is that the Russian text is displayed normally and the Latin is not clear how (some letters are transliterated into Russian, some are displayed as symbols), I thought that the matter was in the encoding, but I can’t even change it.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
WScript.Sleep 1000
WshShell.Exec("chcp 1251")
rem Назначаем кодировку 1251 (не работает)
WScript.Sleep 1000
WshShell.SendKeys "KPACUBO" & chr(13)
rem Отправляем текст в консоль и эмулируем нажатие Enter
WshShell.Run "cmd /K chcp 1251"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question