Originally posted by eech at 2007-6-9 23:06:
Set objShell = CreateObject("Wscript.Shell")
strCommandLine = "Rasphone -a"
objShell.Run(strCommandLine)
set WshShell = CreateObject("WScript.Shell")
WScript.Sleep ...
像是拼凑起来的,同一个对象建了三次。
Sleep的时间太短,会狂弹窗口。
oShellLink.TargetPath = Rasphone.exe 的话,拨号时会多一步选择所以:oShellLink.TargetPath = "rasphone.exe -d 宽带连接"
不熟悉Rasphone.exe是否支持参数静默创建连接,如果支持可以隐藏窗口。否则用sendkeys的方法就不能隐藏窗口。