China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-11-10 20:08
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to call Windows graphical interface applications and simulate key presses (solved) View 3,260 Replies 19
Floor 16 Posted 2006-12-19 21:37 ·  中国 天津 电信
初级用户
★
Credits 97
Posts 43
Joined 2005-07-25 22:07
21-year member
UID 41055
Status Offline
Maybe it's because the dynamic window of the application causes the Sendkeys simulation of key presses to fail. Does anyone with higher knowledge know how to solve it?
Floor 17 Posted 2006-12-19 21:41 ·  中国 天津 电信
初级用户
★
Credits 97
Posts 43
Joined 2005-07-25 22:07
21-year member
UID 41055
Status Offline
Originally posted by redtek at 2006-12-19 11:42:
I don't know what error was prompted when Brother kafen tested? (This may be very critical to solving this problem)

If the installation program is all installed but it doesn't exit by itself (or cannot be properly sent back by.sendkey..

Prompt: dllregisterserver in Flash9b.ocx failed, return code is: 0X80004005
Floor 18 Posted 2006-12-19 22:02 ·  中国 天津 电信
初级用户
★
Credits 97
Posts 43
Joined 2005-07-25 22:07
21-year member
UID 41055
Status Offline
Hehe, happy. Last night, lying in bed, I finally figured it out. It turned out that what I wrote was not wrong, but the delay set was too short. As long as I increase the delay, it will be okay!

set ws=wscript.createobject("wscript.shell")
ws.run "flashie.exe"
wscript.sleep 5000
Ws.Sendkeys "~"

Set the delay to 5000 and it's solved! Thanks to the enthusiastic help from friends above!
Floor 19 Posted 2006-12-20 06:25 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
bat c c++
Floor 20 Posted 2007-01-31 07:01 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
20-year member
UID 63324
Gender Male
Status Offline
Learning with Brother a9319751 ~ : )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Forum Jump: