我觉得这应该很容易,但我还没有弄清楚。Vbscript。如何将密钥发送给SWbemObject?
我有一个可执行文件,当我运行我的VBScript时已经在运行。我想找到可执行文件并调用sendkeys来给它输入。
这是我到目前为止有:
dim service, Process, myObject
set service = GetObject ("winmgmts:")
for each Process in Service.InstancesOf ("Win32_Process")
if Process.Name = "abc.exe" then
myObject = Process
end if
next
myObject.SendKeys "This is a test."
这是不行的,但我认为它看起来与此类似。我基本上只想发送密钥到myObject。
注:我不想跑abc.exe的新实例,我想送输入到已经运行
您不能“的SendKeys到对象”。您只能将按键发送到窗口。 –