Automatically clear Windows logon warning message
I don’t know how widespread a problem this is, but I frequently log on to domains directly or via VPN for clients, and end up with the company’s corporate warning message on my machine on startup. Bad enough to get these from your employer, but incredibly irritating if you were just visiting!
Now, if you work for the company, they are likely using group policy to set this message and you are (probably) stuck with it, but if you are not really part of their domain, it is relatively easy to get rid of the message. You just need to run Regedit and clear the text from two strings:
I found myself doing this reasonably frequently, so I figured I should go ahead and automate the process. I wrote a very small Windows Service that just clears these settings when the machine starts, then shuts down (the service shuts down, not the machine :-). Why a service instead of just an application that runs at startup? Two reasons:
- Since the settings are Local Machine, the code has to run as Admin, which you get for free with a service.
- The service can run before Windows gets as far as the popup message, so I don’t see it even on the first run — if it ran after login, I’d see it once after each reboot. Note that it is possible that the message might appear if you are super-fast when trying to login, but I’ve not had a problem with that.
There are a few caveats/warnings:
- No warranty expressed or implied. Use at your own risk (and if your IT department yells at you, not my fault).
- There are several other ways that the popup can be set (particularly the aforementioned group policy), so if it doesn’t work, a different mechanism is probably in use.
- I don’t generally logout and login under different accounts, so I didn’t bother with that scenario. However, if you run the service executable with an
-instantcommand-line it will reset the registry settings immediately, so you can either do that manually or set it to happen on login (I’ve also provided a batch file).
- I created batch files to install, uninstall or just reset the registry settings without having to go to a command line. The only issue is that all of those things require running as Admin (or the UAC equivalent). The batch files automatically do this using a technique stolen directly from this site, so thanks to Evan Greene for that! If you are less trusting, you can just go to a run-as-admin command prompt and run
- I only tested under Windows 10. No reason that it shouldn’t work on earlier versions though.
- Download the zip file from here.
- Extract everything to some directory. I put mine in a directory called
- Double-click on the
InstallResetService.batfile. It may or may not pop up a UAC message. Note that sometimes Windows will automatically block any downloaded items, so you might (probably) have to manually unblock the batch files and the
ResetLegalNoticeService.exeprogram (for each file, right-click and select properties, then check the “Unblock” checkbox and hit OK).
- Laugh maniacally at doing your bit to subvert the overreaching bureaucrats of the world (consider this step 1 of 1,999,343,252).
If anyone wants the code, feel free to ask in comments and I’ll add it to the post.