2013-02-12 9 views
1

VB 스크립트를 백그라운드에서 URL로 이동 시키려합니다. 백그라운드에서 브라우저를 열고 나중에 닫을 수 있습니다. 더 "침묵하는"것이 더 좋다. VBS가 백그라운드에서 URL로 이동 중

Set WshShell = WScript.CreateObject("WScript.Shell") 
Return = WshShell.Run("iexplore.exe " & myURL, 1) 

가 여기에 또 다른입니다 : : 내 컴퓨터에서 작동하지만 다른 작동하지 않습니다 2 개 구현했다 myURL이이 URL을 포함하는 문자열 변수입니다
Set objExplorer = WScript.CreateObject _ 
("InternetExplorer.Application", "IE_") 
objExplorer.Navigate myURL 
'Determines if the window is visible or not 
objExplorer.Visible = 0 
'Suspend the script for 1 minute 
WScript.Sleep 6000 
'Close the IE (instantiated) window 
objExplorer.quit 

....

위의 중 하나가 내 랩톱에서 작동하지만 서버에서는 작동하지 않는 이유를 알 수 없습니다. 어떤 도움을 주시면 감사하겠습니다. 당신은 자동 방법을 찾고 있다면

답변

5

나는 완전히 인터넷 익스플로러 COM 개체를 삭제하고 XMLHttpRequest 개체에 대한 이동하는 것이 좋습니다 것 :

myURL = "http://www.google.com/" 

Set req = CreateObject("MSXML2.XMLHTTP.6.0") 
req.Open "GET", myURL, False 
req.Send 

WScript.Echo req.ResponseText 
+0

실행중인 사용자가 특정 권한이 있습니까 이런 식으로 할거야? – PLui

+0

그는 스크립트를 읽고 실행할 권한이 필요합니다. –

-1
Set WshShell = WScript.CreateObject("WScript.Shell") 
Return = WshShell.Run("iexplore.exe " & myURL, 1) 
WScript.Sleep 10000 
WshShell.SendKeys "{F6}" 
WScript.Sleep 500 
WshShell.SendKeys "y" 
WScript.Sleep 500 
WshShell.SendKeys "o" 
WScript.Sleep 500 
WshShell.SendKeys "u" 
WScript.Sleep 500 
WshShell.SendKeys "t" 
WScript.Sleep 500 
WshShell.SendKeys "u" 
WScript.Sleep 500 
WshShell.SendKeys "b" 
WScript.Sleep 500 
WshShell.SendKeys "e" 
WScript.Sleep 500 
WshShell.SendKeys "{ENTER}" 
WScript.Sleep 500