Nein, das funktioniert nicht. Aber ich hatte früher auch Windows 98 und ich hab sogar mein altes VBscript noch gefunden. Ist ziemlich ähnlich:
' If not connected, connect to Freenet dependent on daytime
' Open browser with start page
Option Explicit
On Error Resume Next
Dim zeit,provider,i
Dim shellObj,exploreObj
zeit = Abs(Left(Time,2)) ' Get system time
If zeit > 7 And zeit < 18 Then ' Select provider
provider = "Freenet" ' 8 till 18 o'clock
Else
provider = "Freenet18-8" ' 18 till 8 o'clock
End If
' Start Internet Explorer
Set exploreObj = WScript.CreateObject("InternetExplorer.Application")
With exploreObj
.navigate "about:blank"
.visible=0
End With
Do While exploreObj.busy
Loop ' Wait until Internet Explorer is ready
' Connect to provider
Set shellObj = WScript.CreateObject("WScript.Shell")
If Not Connected() Then
shellObj.Run("rundll32.exe rnaui,RnaDial " & provider)
Do
WScript.Sleep 500 ' Wait 0.5 seconds for connection
Loop Until Connected()
With exploreObj
.navigate "http://www.google.de"
.visible=0
End With
For i = 1 To 2
WScript.Sleep 1000 ' Need to wait 1 second
With exploreObj ' Renavigate to avoid Freenet site
.navigate "http://www.google.de"
.visible=1
End With
Next
End If
With exploreObj ' Navigate faster if already connected
.navigate "http://www.google.de"
.visible=1
End With
shellObj.AppActivate "Microsoft Internet Explorer" ' Activate window
shellObj.SendKeys("% x") ' Maximize window
Private Function Connected()
On Error Resume Next
Dim connections,connect
connections = shellObj.RegRead("HKLM\System\CurrentControlSet\Services\RemoteAccess\Remote Connection")
For Each connect In connections
Exit For
Next
Connected = (connect = 1)
End Function
Und falls jetzt noch einer kommt, der sagt, er habe aber Windows 3.11 - hier das ganze als Batch-Datei für DOS:
@echo off
:: If not connected, connect to Freenet dependent on daytime
:: and open Internet Explorer
rasdial | find "Keine Verbindung" >NUL
if errorlevel 1 goto online
set clock=%TIME:~0,2%
set first=%clock:~0,1%
if "%first%"==" " set clock=%clock:~1,2%
set provider=Freenet18-8
if /i %clock% geq 8 (
if /i %clock% lss 18 set provider=Freenet
)
rasdial %provider% >NUL
if errorlevel 633 (
rasdial /disconnect >NUL
echo Das Modem antwortet nicht
echo.
pause
goto end
)
if errorlevel 623 (
echo Es ist keine Verbindung "%provider%" vorhanden
echo.
pause
goto end
)
:online
call "C:\Programme\Internet Explorer\IEXPLORE.EXE"
:end
set clock=
set first=
set provider=