Archive for the ‘windows’ Category

The Missing Menu Bar in Vista

Wednesday, November 11th, 2009

A few weeks back  I discovered the missing menu bar in Explorer in Vista.  All you have to do is press and release the Alt key and the good old “File | Edit | View | Tools | Help” menu pops up.  I find this useful to get to “Map Network Drive” no matter where I am in the computer browser.  Otherwise, the only link was the  context sensitive button that shows up at the “Computer” level.

Only a few more Vista annoyances to go!  OK,  it would have been smarter to post this before Windows 7 launched; however, Vista will be running on this laptop until it dies of old age.

Spoolsv.exe using lots of CPU on a Terminal Server

Friday, July 17th, 2009

I have this recurring problem at one client’s site.  The setup is a small Windows 2003 Terminal Server environment, with remote POS terminals over the Internet – I don’t like this arrangement for the many single points of failure (a couple ADSL lines, a couple routers, a couple switches, a single server, etc.), but that’s beyond the scope of this post.

This client is happens to be running BBL, AKA WinPOS, AKA, WinBPS, over Terminal Server.  I have no comment on the software itself, it’s the arrangement of using it over Terminal Server over the Internet that makes me nervous – no, I had no input into this setup.

A further complication, is that the printers that the software uses, Zebra, label/ticket printers, have poor drivers that I don’t believe to be TS compatible.  They sometimes get stuck when the remote session is closed.  This eventually screws up the Windows spooler service.

When this system stops working, new Remote Desktop sessions fail to start properly.  After logging into the server, I will check the processor usage in Task Manager.  If the spoolsvc.exe process is using a lot of processor time, this is what I do:

N.B. Follow at Your Own Risk.

Stop the spooler service (no one will be able to print, but they probably can’t already):

net stop spooler

Open RegEdit.exe and browse to this part of the registry:

HKLM\SYSTEM\CURRENTCONTROLSET\CONTROL\PRINT\PRINTERS\

At times, I’ll find dozens of stale Terminal Server printers listed.

Export the registry keys first, to make a backup, just in case.

Then delete the Terminal Server printers from that same part of the registery, do NOT delete the local printers.  These are the ones with the “…on MyComputer … in session…” within the printer name.

Deleting these has worked for this particular server several times to resolve the CPU hogging spooler service (spoolsv.exe)… but sometimes they can’t be deleted in RegEdit.

Grab a copy of RegDelNull by Systernals, it’s free as in beer.

Use RegDelNull.exe to remove some of the entries that would not delete manually – I’m looking at you Mr. Zebra Printer Driver.

Here’s what that looks like (anonymized, of course):

C:\Installs>regdelnull HKLM\System\CurrentControlSet\Control\Print\Printers -s

Note: In a recurrence of this problem, I had to run RegDelNull one step higher in the registry, I’m not sure why – i.e. HKLM\System\CurrentControlSet\Control\Print

RegDelNull v1.10 - Delete Registry keys with embedded Nulls Copyright (C) 2005 Mark Russinovich Sysinternals - www.sysinternals.com Null-embedded key (Nulls are replaced by '*'): HKLM\SYSTEM\CURRENTCONTROLSET\CONTROL\PRINT\PRINTERS\Zebra101 _ on MyComputer(from MyComputer2) in session 3\PrinterDriverData\Barcodes\(0x1701)*de 93

You get a prompt to fix the Null.  Say “Yes”.

Then go back up a few steps and delete the problematic printer from RegEdit.  With the null value gone, you can delete it.

Then restart the spooler service.

net start spooler

If this works, the spooler will start, it won’t use a suspicious amount of processor cycles, and the RDP connections will start working immediately – no reboots required.

Then go and find updated drivers.

I’d be glad to hear about a better solution… please comment below.

A free schtasks.exe equivalent for XP Home edition

Monday, December 15th, 2008

It’s funny how one stumbles upon the finer differences between XP Home and XP Professional once in a while. Every good geek knows the biggest limits to XP Home such as no ability to join a corporate network, no Remote Desktop, and no encrypted file system (EFS).  But who knew about a tiny utility that will run a Windows Scheduled Task from the command line? That would be “schtasks.exe”, and it’s not included in XP Home.

The background: I needed a Limited User in Windows to be able to do something requiring Administrative permissions.  There are a few ways to do this, but in this situation, running a scheduled task was the obvious best choice because the task was already there as an overnight maintenance job.

A quick Google search for “run scheduled task from command line” will lead you to the aforementioned schtasks tool.  Well, I could copy the file from an XP Pro workstation, but that would violate Microsoft’s copywrite.

Fortunately, more searching will turn up a reference to an old MS tool “jt.exe” from it’s Windows 2000 Resource Kit.  You can get individual tools from the W2K ResKit here: ftp://ftp.microsoft.com/reskit/win2000/. The license to JT and is much more permissive.  You’re free to use it, but at your own risk.

The “JT” syntax is not straight forward to me.  But these the two examples will probably help:

This lists all tasks: jt.exe /se

This will run (“activate”?) a task (you do not need to include the .job in the TaskName): jt.exe /sac TaskName /rj

On the XP Home Edition computer I was setting this on, the Limited User could run all the scheduled tasks, even when it couldn’t “see” the task in the list. YMMV.

One could  make this end-user friendly by wrapping a batch file around it and put an icon with a link to your script on the Desktop.