Set wShell = CreateObject ("Wscript.Shell") wShell.Run wShell.ExpandEnvironmentStrings("%windir%") & "\system32\userinit.exe" Dim prog_files prog_files = wShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") if(StrComp(prog_files, "%PROGRAMFILES(x86)%") = 0) then prog_files = wShell.ExpandEnvironmentStrings("%PROGRAMFILES%") end if Function HasInternet HasInternet = false Set wShell = CreateObject ("Wscript.Shell") wShell.Run "cmd /c ping 8.8.8.8 -n 1 > %temp%\inet.log", 0, true Set fso = CreateObject("Scripting.FileSystemObject") Set file = fso.OpenTextFile(wShell.ExpandEnvironmentStrings("%temp%") & "\inet.log", 1) text = file.ReadAll file.Close fso.DeleteFile wShell.ExpandEnvironmentStrings("%temp%") & "\inet.log" if(inStr(text, "=32")) then HasInternet = true end if End Function Function WaitInternet Do Until HasInternet Loop End Function