I want to make keys combination to file exmp:
ctrl+alt+1
- make this combination to file, then click on file do this key combination. I used an kvm switch, so I want to make files combinations.
I want to make keys combination to file exmp:
ctrl+alt+1
Pure batch is not able to simulate any keystrokes. However, you can use a different scripting language for this. In this example, I will use VBScript and call this script from a batch file:
Set Wsh=WScript.CreateObject("WScript.Shell")
Wsh.SendKeys "<what ever key combination you need>"
Store this code in a file, say KVM1.vbs
. Now create a batch file wich will cann the vbs file:
@ECHO OFF
wscript "C:\some_path_to\KVM1.vsb"
Now the last thing: how to send CTRL+ALT+1
? In VBScript ^
means CTRL
, %
means ALT
so CTRL+ALT+1
would be ^%1
. So the last thing to do is to replace <what ever key combination you need>
in the script above with ^%1
. This should simulate pressing CTRL+ALT+1
on the keyboard.
However, depending on you KVM this won't help you. Some KVMs will recognize keystrokes simulated by the OS but some won't. As you keyboard is usually connected directly to the KVM the KVM itself will recognize the combination pressed on the keyboard. Any simulated keystrokes from the OS take place _IN_THE_OS_ so they won't be visible to the KVM.