Archive for the 'Windows Vista' Category
Identifying the unidentified problem with Windows Firewall
Recently Windows Vista has been refusing to show the Windows Firewall Settings dialog box and instead showing the ever so informative message: “Windows Firewall: Due to an unidentified problem, Windows cannot display Windows Firewall settings”.

No clues. Nothing in the Event Log. Nothing. Brilliant.
Well I had a brain wave this morning about what might be causing it. Thankfully it turned out to be right. I remembered that on our Windows Domain we have a few Group Policy settings that apply to Windows Firewall.
In this case the culprit was the “Define program exceptions” that had a few old entries for AVG 7.5 Network Edition. As we’d upgraded to AVG 8.0 recently the program paths were no longer valid, nor really necessary. So I removed them entirely and set the policy back to Not configured. To verify it worked I ran gpupdate /target:computer /force at a command prompt on my workstation and voila: the Windows Firewall Settings dialog box would now appear once more.
Group Policy for Windows Firewall is stored on client machines in the the Registry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall
So if you’re not on a domain and there are registry entries in this location that have been set for some reason, then adjusting them will have the same effect as changing the Group Policy. If you are on a domain then getting the Group Policy fixed is obviously the right approach.
Hope that helps you – leave a comment if it does.
Shortcut to Switch User in Windows Vista
At home, our PC running Vista is rarely rebooted and is either in a low power state sleeping or being used by either me or my wife. One thing we’ve taken great advantage since the XP days is Fast User Switching which allows someone else to log in to their desktop whilst yours is kept running in the background. My wife and I had got quite used to doing a quick WinKey+L (as you do) before relinquishing control of the PC to one another. In Windows XP WinKey+L is does a “lock workstation” which in non-domain machines takes you back to the Windows logon screen. Unfortunately on Vista it takes you to a “workstation locked” screen, so you then have another mouse click on the Switch User button (followed by monitor re-syncing itself - why does it do this? All users run at the same screen resolution) to take you to the users screen. Of course there is a “Switch User” command tucked away in the little menu next to the lock button on the start menu - but a quick keystroke is what we’re after here.
So - I go off searching for a shortcut key that does a “switch user” rather than “lock workstation”. After a 20 minutes fruitless Googling for some special key combination, I sat back, thought about it logically and came up with this solution:
- Create a shortcut on your desktop to TSDISCON (* see below) and call it something like “Switch User”
- Go the shortcut Properties page and assign a shortcut key. Note that unfortunately you can’t use the Windows Key in your shortcut - so I went for CTRL + ALT + SHIFT + L
- Right click Start button and choose “Open All Users” and move the shortcut into the Programs folder (confirming the UAC prompt as you go).
- Log out, and back in again. This is necessary because Explorer hasn’t noticed there’s now a shortcut with a new shortcut key it should be taking notice of.
And that did it. CTRL + ALT + SHIFT + L isn’t quite a neat as WinKey+L but it’s a hell of a lot better than poking around in the Start Menu.
* What is TSDISCON you ask? It’s the Terminal Services Disconnect command. Fast User Switching is all made possible by the core Terminal Services technologies which introduced the concept of multiple Window Stations or “sessions” running concurrently on the one machine. It was of course originally designed to support multiple users connecting concurrently to these sessions over the network using the Remote Desktop Protocol (RDP), but Windows XP took advantage of the multi-session architecture to enable Fast User Switching. (The RDP stuff is still there but hobbled to only allow one user to connect at a a time.)
UPDATE: If you don’t have tsdiscon.exe on your system for some reason (maybe it’s only available in Business/Ultimate or something) then you can use the following C# code (compiled into a Windows EXE using C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe if you don’t have Visual Studio) to do the same thing. Tsdiscon.exe is just a wrapper around WTSDisconnectSession. I used Dependency Walker (aka depends.exe) to find out what was being used:
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
class Program
{
[DllImport("wtsapi32.dll", SetLastError = true)]
static extern bool WTSDisconnectSession(IntPtr hServer, int sessionId, bool bWait);
const int WTS_CURRENT_SESSION = -1;
static readonly IntPtr WTS_CURRENT_SERVER_HANDLE = IntPtr.Zero;
static void Main(string[] args)
{
if (!WTSDisconnectSession(WTS_CURRENT_SERVER_HANDLE,
WTS_CURRENT_SESSION, false))
throw new Win32Exception();
}
}
UPDATE 2: For your convenience: I’ve compiled the above and packaged it into a ZIP along with the source for download here.
Fixing Vista folder annoyances
I found this gem in Dan Maharry’s RSS feed as part of his del.icio.us bookmarks. It’s a few registry edits to stop Windows Explorer auto-selecting a different folder view based on its content, e.g. normally if a folder happens to have a GIF or JPEG in it, Explorer will “helpfully” switch to thumbnail view.
Keith Miller posted a registry tweaks in the TechNet forums which I’ve rolled up here (mostly for for my own convenience) into a single batch file which also restarts Explorer:
setlocal set BASE_KEY=HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell :: Delete cached folder views reg delete "%BASE_KEY%\Bags" /f reg delete "%BASE_KEY%\BagMRU" /f :: Set default folder template reg add "%BASE_KEY%\Bags\AllFolders\Shell" /v FolderType /d NotSpecified :: Restart Explorer taskkill /f /im explorer.exe start explorer.exe
If you don’t know what a batch file is or how to use it then you shouldn’t be using this :-p. Likewise, it works for me but your mileage may vary…
Comments(0)