Martin's technology blog – Vista

Blog content

Latest posts

Active categories:

More tags ...

By date:

    (No recent posts)

Blog calendar

March 2021
Mo Tu We Th Fr Sa Su
 << Feb Apr >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Vista: User profile startup programs not executed

posted by Martin Rubli at 17:34

If you thought buying a new computer and installing a fresh copy of the latest and greatest (only in terms of disk space usage, obviously) Windows Vista is a good start for productive computing then you obviously haven't reckoned with Microsoft's talent to break the simplest of features.

While setting up my system I eventually noticed some strange behavior: The startup programs that I had placed into the start menu were not executed. On the other hand, some startup programs seemed to be executed twice; in my case I ended up with two OneNote icons in the tray bar.

I didn't make the connection at first but a closer analysis showed that the links in

C:\Users\martin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

were not executed on log in whereas the ones in

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

were executed twice.

A quick scan of the registry (which brought up a whole new bug, but more about that in the next article) quickly found the reason of this strange behavior.

In the

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

path there is an entry called Start Menu, which, in my case, contained the following, erroneous path:

%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup

This obviously makes no sense because, as the registry path already indicates, these are the User Shell Folders. All the other entries in the same registry location were correct though.

The fix was trivial, I simply just replaced it with the following:

%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Sidenote: There's a second registry location that also contained the wrong folder, though as a REG_SZ instead REG_EXPAND_SZ string and therefore without the environment variables:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

Changing that one alone didn't have any immediately visible effect but to be on the safe side I would recommend changing that too.

It's also funny to see that when you right click the Startup folder in the start menu and choose 'Open' or 'Open All Users' Explorer doesn't seem to retrieve the path from any of the above registry locations.

How the wrong path had gotten there in the first place is beyond me. But when I started thinking about it I suddenly remembered that I had fixed the exact same problem at one point during my very first Vista experiment. Apparently more than a year and one service pack later things haven't changed. Let's wait for Service Pack 2, maybe that will ... Nah ... Put a lid on that hope's coffin and nail it shut. Six (6.0?) feet under is where Vista hopes are at home.

ASUS NX1101 跟Vista六十四bit不能用

posted by Martin Rubli at 14:08

"ASUS Networks - Built to connect ..." Well, temporarily.

When I buy a network card there's one thing, above all, that I want it to do: connect and stay connected. Is that too much to ask for? Apparently it is when you buy an ASUS NX1101 and try to run it on a 64-bit Windows Vista.

It all started so well. After being scared off by the prices of PCIe network cards I decided to go with a good old PCI one. I bought it and headed home. After a quick search on Windows Update Vista automatically downloaded and installed the drivers. That's how it should be.

The next time I my computer wakes up from hibernation the first surprise. No network. Been there, done that, so I restart the Corega wireless/Ethernet router (necessary about two to three times per week even with the latest firmware) and try again. Nothing. Even pinging the router doesn't work. Only disabling the network and reenabling it brings the connection back to life.

Unfortunately it's not a one time thing, it's reproducible every single time, but not on XP 32-bit. So I start looking for an updated driver and, of course, I find one on their website. Actually, I find two of them - only ASUS knows why, - so I take the newer one because the older one is identical to the one that Windows downloaded automatically.

In an optimistic mood I start installing it but after a while Windows complains the driver is not intended for my platform. I double check that I have the right driver but the folder name says 64-bit and the INF file looks okay. Awesome.

More or less by accident I notice something:


That's right. The driver binary is 0 bytes in size. Either this is just the slimmest driver ever or somebody at ASUS' quality assurance lab must have a very sound sleep. And some other people too given that the "driver" has been online for about four months.

Being a driver developer myself I'm pretty understanding when it comes to power management bugs, but putting up a zero byte driver is far from excusable. Especially if the support form and live chats don't work.

Today I brought my card back to the store and got a new D-Link one (DGE-530T). So far it works like a charm, even after hibernating.

There's an upside to the story though: Apparently my Chinese, limited as it is, is now good enough to get a broken network card exchanged and buy a new one. By the amount my confidence in ASUS has shrunk my self-conficence has grown. That's not half bad. :-)

OS detection in a Windows shell script

posted by Martin Rubli at 07:26

There seem to be many ways to detect the Windows version (e.g. XP vs. Vista) from a batch file, some of them fairly complicated. It's not exactly as easy as it should be because there's no decent environment variable and the output of ver is difficult to parse.

However, I found the following to work just fine:

: OS detection
for /f "tokens=3" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion') do (
	set WindowsVersion=%%i
if "%WindowsVersion%"=="5.1" set IsWindowsXP=1
if "%WindowsVersion%"=="6.0" set IsWindowsVista=1
: Show some debug information echo Windows version: %WindowsVersion% if defined IsWindowsXP echo IsWindowsXP = true if defined IsWindowsVista echo IsWindowsVista = true