Here's the current NetCheck program that seems to work reasonably well here on my netbook with both wired and wireless connection, it requires use of Group Policy Editor and as such it's restricted to Pro+ versions of Windows - I've only tested it on XP Pro SP3.
Caveat: Currently it doesn't reinitialise itself to display on the logon screen if the current user logs off - that's about it. I'm still looking at fixing this by calling it again, (probably needs higher privileges so it can display on the logon screen again).
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $inifile = @WindowsDir & "\NetCheck.ini"
If Not FileExists($inifile) Then _Initialise()
If $CmdLine > 0 Then
Case $CmdLine = "logon"
$logon = 1
Case $CmdLine = "startup"
$logon = 0
$logon = 0
If $logon Then TraySetState()
If (ProcessExists("explorer.exe") > 0) And (Not $logon) Then ExitLoop
$socket = TCPConnect($TIP, $TPort)
If $socket = -1 Then
If $logon Then
ToolTip("Not Connected", 0, 0,"Network Status", 3, 5)
If $logon Then
ToolTip("Connected", 0, 0,"Network Status", 1, 5)
IniWrite($inifile, "Main", "TestServer", "126.96.36.199")
IniWrite($inifile, "Main", "TestPort", "53")
IniWrite($inifile, "Main", "TTime", "100")
IniWrite($inifile, "Main", "Hotkey", "+!\")
$file = FileOpen($inifile, 1)
FileWrite($file, @CRLF & "; Where: TestServer = IP address of a server to make a test connection to." & @CRLF & "; TestPort = Server port to make a test connection to." & @CRLF & "; TimeOut = Test connection timeout value in milliseconds. Test will" & @CRLF & "; fail if it can't make a connection in this time." & @CRLF & "; Hotkey = Key sequence to terminate program." & @CRLF & "; + = Shift" & @CRLF & "; ! = Alt" & @CRLF & "; ^ = Control" & @CRLF & "; # = Windows")
To set it up, copy it to both of the following directories, (not really required in two locations, just makes the script dialogue easier later):
Run the Group Policy Editor, (eg. Start->Run->gpedit.msc):IDEA: Wireless sensor
Specify a Windows Startup script as follows:IDEA: Wireless sensor
and a User Logon script as follows, (Note
the 'logon' parameter):IDEA: Wireless sensor
On first run it will create the file C:\Windows\NetCheck.ini for which the defaults are:[Main]
It'll try connecting to Googles' DNS server, if it doesn't make a connection within 100ms it assumes there's no access. You can change it to use your local DHCP server, (port 67 by default), since that's where your laptop IPs come from.
It only reads from the file upon execution, so if you make a change you need to stop then start it again. You can run it from the CLI - just remember to add the 'logon' parameter since you'll be logged in.
Nothing bad will happen if you forget, it'll just exit immediately because it sees the explorer.exe process.
You can kill it either by right-clicking on the tray icon and selecting Exit, or the default hotkey combination of Shift+Alt+\ .
It still only tries to connect every 5 seconds, I didn't see a need to make it any faster.
The ini file is the only thing it writes to the drive, the tray icons are stored in the exe - I've only added them to the archive in case you want to do some fiddling and recompile.
In theory, if all goes well, on the next reboot you should end up with:IDEA: Wireless sensor
And after log on:IDEA: Wireless sensor
Still thinking of trying to make it a service but I couldn't get it to interact with the Desktop - installed and ran OK, was getting all the right answers just didn't display anything - more reading required me thinks.