Is there a way to use sendkeys (or something equivalent) from (not to) the command prompt?
Open a command prompt, type start /? and hit Enter.
Make sure the Enable Ctrl key shortcuts option is checked. You can also check the Use Ctrl+Shift+C/V as Copy/Paste option. Click OK to save the setting. Then you should be able to use the keyboard shortcut Ctrl + C and Ctrl + V to copy and paste in Command Prompt window.
Without creating temporary files. The 'loop' was shown only so that you could open a notebook for output. Remove it after.
@echo off
:loop
::------------begin main code------------
set command=new ActiveXObject('WScript.Shell').SendKeys('WoW{ENTER}{ENTER}');
for /f "delims=" %%i in ('mshta "javascript:%command%close(new ActiveXObject('Scripting.FileSystemObject'));"') do set "var=%%i"
::-------------end main code-------------
timeout /t 1 /nobreak >nul
goto :loop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With