2012-06-02 2 views
1

내 Gmail을 열 수 있었지만 다음 URL을 열려고 시도했습니다. 내가 할 수 있을까? 방법? (WshShell.Exec ": \ TEST.BAT C")VBS 파일 bat.file을 시작합니다

'Script starts here 
Set WshShell = WScript.CreateObject("WScript.Shell") 

'Wait 1 second (1000 ms) 
WScript.Sleep 1000 

'Open IE and go to gmail.com (your IExplore.exe file location may be different) 
WshShell.Exec "C:\Program Files\Internet Explorer\IEXPLORE.EXE gmail.com" 

'Allow time for IE to finish loading (about 15 secs for slow connections/machines) 
WScript.Sleep 10000 

'Send the login info in the login box 
'login (change username to your login name 
WshShell.Sendkeys "xxxxxxxxxx" 
WScript.Sleep 500 

'hit TAB key to move to password field 
WshShell.Sendkeys "{TAB}" 
WScript.Sleep 500 

'Send the password info 
'change your password to your login password 
WshShell.Sendkeys "xxxxxxxxxxxxx" 
WScript.Sleep 500 

'Hit 'Enter' key to log-in 
WshShell.Sendkeys "{ENTER}" 
WScript.Sleep 10000 

WshShell.Exec "C:\test.bat" 

'Allow time for IE to finish loading (about 15 secs for slow connections/machines) 
WScript.Sleep 15000 

'Send the login info in the login box 
'login (change username to your login name 
WshShell.Sendkeys "xxxxxxxxx" 
WScript.Sleep 500 

'hit TAB key to move to password field 
WshShell.Sendkeys "{TAB}" 
WScript.Sleep 500 

'Send the password info 
'change your password to your login password 
WshShell.Sendkeys "xxxxxxxx" 
WScript.Sleep 500 

'Hit 'Enter' key to log-in 
WshShell.Sendkeys "{ENTER}" 
+0

. 자체 자동화 객체가 있습니다. – Nilpo

답변

0

편집 :

필요 오른쪽 하나를 해결하기이 나를 위해 일했다.

Test.vbs를

Set WshShell = WScript.CreateObject("WScript.Shell") 
WshShell.Exec "test.bat" 

및 스크립트 IE 직접 오프 더 나은 것 TEST.BAT

@echo off 
start www.yahoo.com 
+0

빠른 답장을 보내 주셔서 감사합니다. 나는 그것을 시도하고 작동하지 않습니다. – DeafTimberWolf

+0

나는 start/d https : // my url.com – DeafTimberWolf

+0

에서 벗어난 @echo 박쥐 파일을 만들었지 만 cmd.exe를 실행했지만 다른 URL은 열지 않았습니다. 나는 박쥐 파일에 http://yahoo.com을 시작했다. VBS 파일은 작동하지만 bat.file이 아닌 것 같습니다. – DeafTimberWolf