not sure what your little program means but one school has about 60 laptops that this would need to be done with.-techidave (December 16, 2010, 07:33 AM)
It would have to become active before the user logged in.-techidave (December 15, 2010, 09:17 PM)
Sorry to butt into your thread skwire, it's 0325 here and I was bored-4wd (December 16, 2010, 10:23 AM)
I may not be following you SJ, but what I need is something that the student can see on the laptop.-techidave (December 16, 2010, 08:33 AM)
Students typically turn a computer on and as soon as the login window appears, they try to log in. Well some of our laptops take just a little longer for the wireless card to iniate, or become fully operational. But in the mean time they can not log in because they cannot see the server. We have multiple users using them, and they are always connected via wireless.
They just need some kind of a "signal" telling them "when" they could log in.-techidave (December 16, 2010, 11:21 AM)
Joker, I am not sure what your template is like but am willing to give it a whirl.-techidave (December 16, 2010, 08:36 PM)
2) Displays a Tooltip on the logon screen with network status - I can't test whether it has connected since it doesn't connect until I've logged on here, (just a LAN network).-4wd (December 17, 2010, 04:54 PM)
The only thing left is trying to get the SysTray icon to turn on - maybe I need to put a delay in between detection of explorer.exe and turning it on? Ideas anyone?-4wd (December 17, 2010, 04:54 PM)
Just had a thought, I couldn't find anywhere after a quick search, what is set as the default directory when you run something from Group Policy Startup? The directory where the executable is or something else?-4wd (December 17, 2010, 04:54 PM)
EDIT2: Argh! The Tooltip doesn't come back when you log off :wallbash:-4wd (December 17, 2010, 04:54 PM)
2) Displays a Tooltip on the logon screen with network status - I can't test whether it has connected since it doesn't connect until I've logged on here, (just a LAN network).-4wd (December 17, 2010, 04:54 PM)
I could be missing something, but couldn't you just start the comp with the network cable unpluged, then plug it in to see the status change? The media connection state change is (basically) the same wired vs. WiFi.-Stoic Joker (December 17, 2010, 10:25 PM)
The following snippet is from T-Clock, it checks for a valid system tray/clock window handle before the hook is inserted. A stripped down version should be just what you're after:
EDIT2: Argh! The Tooltip doesn't come back when you log off :wallbash:-4wd (December 17, 2010, 04:54 PM)
Relaunch with logoff script?
However, it doesn't seem to work - I'm wondering, with a Domain Controller doesn't a network connection have to be established before logon, whereas with a normal LAN network the connection is established after logon?-4wd (December 17, 2010, 11:02 PM)
Have to do some debug output to see if the arp command is actually being called that early.-4wd (December 17, 2010, 11:02 PM)
No, it doesn't have to. By default, the answer is no. There is a policy that can be set by using group policy or active directory. I have tried changing it to wait, but that doesn't always help either.-techidave (December 18, 2010, 06:19 AM)
[Sorry if I get a bit Captain Obvious here, I'm just trying to make sure we're on the same page]-Stoic Joker (December 18, 2010, 10:12 AM)
Um... If you're driving at the distinction between a Workgroup and Domain networks ...Then yes...Sort of. In a workgroup environment you initially authenticate to local machine, and then to network resources later if/when you access them. In a domain you're authenticated by the domain controller before you access anything, including local machine. There are exceptions for cached credentials/domain accounts...But those aren't important right now.
The key here is to look for a media connection first, then "verify" it by testing for an IP connection. So the program should continue looping through the adapter iteration until it finds one with a default gateway that isn't 0.0.0.0. Then and only then it should do the (IP to MAC Address) ARP lookup to verify that the IP network is "live" making it a relatively safe assumption that (the hounds can be released) a domain controller is then available.
Hint: Gateway connection isn't really required or guaranteed at this stage, hence the ARP test could fail even with a valid connection because no traffic has as of yet been sent to the gateway. SendARP(...) is a local machine query of the ARP cache, not an on-the-wire query for remote data.
...Which makes me an idiot. :wallbash: Sorry... :-[ ...Ping would (/will have to) be the correct answer as a last stage validation of IP connectivity. Just don't start with it in/as the initial loop timeouts are a nightmare.
But 4wd, you said to copy "it", what is "it"? In the zip file, I only see 5 files of which one is the netcheck.exe. perhaps that is it?-techidave (December 20, 2010, 06:45 AM)
AVG just caught it as a virus. I am sure that there isn't one. Probably just the autoit script?-techidave (December 20, 2010, 07:16 AM)
I have joined my domain but now it takes forever to "run the startup script". Like 5 or 6 minutes.-techidave (December 20, 2010, 07:58 AM)
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).-4wd (December 19, 2010, 10:43 PM)
So the short question is can the icon show up any other time the login window is there without doing a restart or power on?-techidave (December 20, 2010, 01:33 PM)
I have joined my domain but now it takes forever to "run the startup script". Like 5 or 6 minutes.-techidave (December 20, 2010, 07:58 AM)
Here it only takes a few seconds to run it, the tooltip shows up after the login screen, however it looks like you're using the 'classic' login screen and not the newer XP Welcome type - something that I ought to of thought of but didn't :-[ So a bit more testing.-4wd (December 20, 2010, 05:32 PM)
EDIT: Just tried again with classic logon and it works OK here. The logon prompt shows up immediately with tooltip showing up a few seconds later, both when there is and isn't a connection. The NetCheck.exe should return immediately, (well, it does from a normal CLI), I wonder if it's possible to try running with the RunAs command, (sorry, no experience with that - perhaps SJ can help)?-4wd (December 20, 2010, 05:32 PM)
I don't suppose anyone could tell me how to set up a simple Domain that I could try and replicate this with, (I can set up another laptop as a Domain Controller under XP Pro)?-4wd (December 20, 2010, 05:32 PM)
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).-4wd (December 19, 2010, 10:43 PM)
Does 5 or 6 minutes sound about right for the WiFi card init? I'm wondering if the script is waiting for the program to return. If the ping is every 5 sec, can you (just as a test value) add a sending ping X message to the prog so it's "pulse" can be checked?-Stoic Joker (December 20, 2010, 10:02 PM)
EDIT: Just tried again with classic logon and it works OK here. The logon prompt shows up immediately with tooltip showing up a few seconds later, both when there is and isn't a connection. The NetCheck.exe should return immediately, (well, it does from a normal CLI), I wonder if it's possible to try running with the RunAs command, (sorry, no experience with that - perhaps SJ can help)?-4wd (December 20, 2010, 05:32 PM)
Now if you put the wrong WEP key in your WiFi card and let it partially connect, DHCP should fail leaving you with an APIPA address and roughly the state you need to test with/for/on.
Running it on logoff isn't really the issue, because the WiFi card stays on. The trick is to get it to run on wakeup from sleep/hibernation when the connection has dropped because the WiFi card was napping.
I have joined my domain but now it takes forever to "run the startup script". Like 5 or 6 minutes.-techidave (December 20, 2010, 07:58 AM)
Here it only takes a few seconds to run it, the tooltip shows up after the login screen, however it looks like you're using the 'classic' login screen and not the newer XP Welcome type - something that I ought to of thought of but didn't :-[ So a bit more testing.-4wd (December 20, 2010, 05:32 PM)
Does 5 or 6 minutes sound about right for the WiFi card init? I'm wondering if the script is waiting for the program to return. If the ping is every 5 sec, can you (just as a test value) add a sending ping X message to the prog so it's "pulse" can be checked?-Stoic Joker (December 20, 2010, 10:02 PM)
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).-4wd (December 19, 2010, 10:43 PM)
Running it on logoff isn't really the issue, because the WiFi card stays on. The trick is to get it to run on wakeup from sleep/hibernation when the connection has dropped because the WiFi card was napping.
The script doesn't send any pings, it just tries to open a connection to a server, (any type of server, just need an IP and port), if it can't make one within 100ms, (default value), then it fails and the script continues. So in theory, it's not actually waiting for anything to come back unless its connection is accepted in which case the script will continue to progress in under the 100ms wait time. I could make the 5 second delay between connection attempts shorter, (I didn't want it to get flagged by any security programs as excessive pings sometimes do), or configuable - if I took out the delay then it would attempt connections every 100ms or less.-4wd (December 20, 2010, 11:19 PM)
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).-4wd (December 19, 2010, 10:43 PM)
Running it on logoff isn't really the issue, because the WiFi card stays on. The trick is to get it to run on wakeup from sleep/hibernation when the connection has dropped because the WiFi card was napping.-Stoic Joker
Well, it kinda is at the moment because the instance running from the Startup script event terminates on detection of 'explorer.exe' process. And the instance running at Logon event is terminated when the 'explorer.exe' process terminates.
So when it drops back to the logon screen, there is no NetCheck program running - this is why I would like to run it as a service if I could get the damn thing to interact with the display :mad:-4wd
The script doesn't send any pings, it just tries to open a connection to a server, (any type of server, just need an IP and port), if it can't make one within 100ms, (default value), then it fails and the script continues. So in theory, it's not actually waiting for anything to come back unless its connection is accepted in which case the script will continue to progress in under the 100ms wait time. I could make the 5 second delay between connection attempts shorter, (I didn't want it to get flagged by any security programs as excessive pings sometimes do), or configuable - if I took out the delay then it would attempt connections every 100ms or less.-4wd (December 20, 2010, 11:19 PM)
Ah! (Port Connection) ...Therein lying the gotcha I mentioned at the beginning.Port Connection's do a 3-way handshake:
SYN (outbount request)
SYN-ACK (target response)
ACK (outbound acceptance)
Slamming the socket shut without the SYN-ACK requires a non-blocking raw socket connection that creates its own thread and uses select(...) to check for writability before timingout and slamming shut... (Which still isn't 100% reliable after XP SP2...) ...otherwise the default timeout (graceful closure) is in the 3-5 min range.-Stoic Joker (December 21, 2010, 08:37 AM)
That's why I'd suggested using something strictly local for the initial (test) loop like a system call level iteration of the adapter statuses. While not directly related (it only pulls address info from the first adapter it finds - but you could loop it to get the others), here's an example of the type of function you would need:Code: C++ [Select]
.....
Note: that is actually the code that Page Countster uses to get the default LM IP address range for the Scan for Printers dialog box.
Well, it kinda is at the moment because the instance running from the Startup script event terminates on detection of 'explorer.exe' process. And the instance running at Logon event is terminated when the 'explorer.exe' process terminates.
So when it drops back to the logon screen, there is no NetCheck program running - this is why I would like to run it as a service if I could get the damn thing to interact with the display :mad:-4wd
Damn, that is a sticky one. Apparently "Allow service to interact with desktop" was depricated a while back due to the need for more complete Session 0 isolation - which quickly sinks out-of-my-depth (f0dder...?) - So the new more correct(er) way is to use two applications that pitch-N-catch. The service does the test & pitch, and the User GUI does the catch & display.
Maybe use WMI to look for (signs of life) a wake event?
Does a wired connection really need anything like this? I do not know, I am just asking. :D :o-techidave (December 22, 2010, 05:42 AM)
I've used this key/profile decription in the past to enable num-lock on the logon screen, so it could be worth a shot to try running/launching it from there.That was on Windows NT, and for newly created accounts only, from W2K on it (sort of) remembered the last state of num-lock-Stoic Joker (January 04, 2011, 06:49 AM)
Okay, this is either the right answer, or the stupidest thing I've ever said...I'm not sure which (be gentile).
But, I ran across this: Displaying server/domain name on the logon screen. (http://social.technet.microsoft.com/Forums/en-US/windowsserver2008r2general/thread/aefaceb3-8ab1-4290-a812-cda3dcd5f08b)-Stoic Joker (January 09, 2011, 09:05 AM)
So if the service is creating a plain text file, why not have it create an .htm file, and set the logon screen's wallpaper to that. Assuming the page could be made to auto-refresh and display status changes it could work.
I never actually played with NT4 much, so I can't say much there. But I do recall using that trick on an XP machine for a client that had an alphanumeric password and couldn't remember to hit numlock.I've used this key/profile decription in the past to enable num-lock on the logon screen, so it could be worth a shot to try running/launching it from there.That was on Windows NT, and for newly created accounts only, from W2K on it (sort of) remembered the last state of num-lock-Stoic Joker (January 04, 2011, 06:49 AM)-Ath (January 09, 2011, 09:47 AM)
Is it possible to do that on XP, (have a webpage as a background on the logon screen) ?-4wd (January 09, 2011, 10:52 AM)
Is it possible to do that on XP, (have a webpage as a background on the logon screen) ?-4wd (January 09, 2011, 10:52 AM)
The gist of the thread seemed to be that it would/did work before (with older OSs), but the OP was having trouble getting it to work on Server08 R2. So I'm hoping that doing it on XP wont be a wild goose chase.-Stoic Joker (January 09, 2011, 11:00 AM)
Value | Meaning |
MIB_IF_OPER_STATUS_NON_OPERATIONAL | LAN adapter has been disabled, for example because of an address conflict. |
MIB_IF_OPER_STATUS_UNREACHABLE WAN | adapter that is not connected. |
MIB_IF_OPER_STATUS_DISCONNECTED | For LAN adapters: network cable disconnected. For WAN adapters: no carrier. |
MIB_IF_OPER_STATUS_CONNECTING | WAN adapter that is in the process of connecting. |
MIB_IF_OPER_STATUS_CONNECTED | WAN adapter that is connected to a remote peer. |
MIB_IF_OPER_STATUS_OPERATIONAL | Default status for LAN adapters |