问题:
检查网络连接状态,在本机里运行以下脚本,PR.StatusCode=0,即表示网络是连接状态。
但在vmware虚拟机里运行脚本,总提示 PR.StatusCode=11010,即连接超时,表示网络连接不通。 手动打开IE,是可以正常联网的。
另:如果虚拟机里禁用网络的话,运行脚本,PR.StatusCode 是null .
请问有知道问题出在什么地方的吗? | TARGET = "www.163.com" | | stnCx="." | | Set Pre = GetObject("winmgmts:{impersonationLevel=impersonate}//" & stnCx & "/root/cimv2"). ExecQuery("SELECT * FROM Win32_PingStatus " & "WHERE Address = '" + TARGET + "'") | | For Each PR In Pre | | WScript.Echo PR.StatusCode | | If PR.StatusCode <> 0 Then WSCRIPT.QUIT | | Next | | WScript.Echo 1COPY |
|