- 帖子
- 24
- 积分
- 25
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2011-7-1
|
我在用批处理调用py文件时,也遇到了这个问题,开始计划用批处理解决,但是搜遍网络似乎无解,最后终于在百度知道窥到一个解答,完全能解决这个情况,不忍独享:
on error resume next
set wshshell=CreateObject("Wscript.shell")
set fso=Createobject("Scripting.FileSystemObject")
wshshell.run "cmd.exe"
'str="dir C:\"
str="abcdef"
wscript.sleep 1000
'for i=1 To len(str)
s=mid(str,1,len(str))
wshshell.sendkeys s
wscript.sleep 100
'next
wshshell.sendkeys "{enter}"
'根据是否需要回车,确定是否需要注释掉上面一行语句。
wscript.quit
'设置缺省输入法为英文
附件: |
|