Muchtall Window Arranger (Save Window Positions and Size)

Over the years, I've noticed that there's one "drawback" to multiple heads/screens on a laptop workstation. I get in the habit of arranging my workspace how I like it, where eventually I have 8-10 windows in positions I would prefer to be permanent whenever I hook up my external 2 heads. When I undock, of course everything collapses back to my main display. When I re-dock, the windows remain in a cluttered pile on my main screen. In addition to this, changes in resolution can result in windows needing to be re-sized as well.

I've found one or two utilities over the years that have allowed me to save window positions and sizes, but nothing that handled it for me as automatically as I would have liked. So I wrote my own in AutoHotKey: the Muchtall Window Arranger.

It's fairly simple, yet powerful if you want it to be. Since it's written in AutoHotKey, you can write custom filters to apply to your window rules (assuming you know AHK). But, for the casual user, it simply grabs the active window information and allows you to alter the conditions that apply to the window matching before saving those settings.

Downloadfrom GitHub: Muchtall Window Arranger
You must have AutoHotKey installed before using this script.

There's one setting in the source you'll probably want to modify before you get started. The variable "NumberOfScreens = 3" should be changed to the number of heads you want to have activate the auto-rearrange feature. If this is set to something higher than you'd ever have installed (say 10), the auto-rearrange feature should never activate. Since version 20200817, you no longer need to specify the number of screens. Instead, the script automatically detects the current screen layout, and generates separate profiles for them!

Screenshots:
Task Tray Menu
ahkmenu

Capture/Save window settings
newwindow

I'll probably clean up the rough edges as I get feedback on it. I know there may be some use for features like re-arranging for multiple head settings, so there's work to be done.

Edit: Moved code to GitHub repo

Finicky: A2DP Bluetooth Stereo on Dell Latitude E6500 w/ Windows 7 64-bit

I thought I'd write up a little bit on my ongoing hassles with A2DP (Bluetooth Stereo Headphones) on Windows 7. I would say it's a hassle only on Windows 7, but in all honestly, my experiences with A2DP on WinXP weren't much better, just different.

To start out, a little background: My first success with A2DP was with my Dell D820 with WinXP and the Toshiba Bluetooth stack. This was far from stable, but I could at least get it to work consistently by following a routine involving disabling and re-enabling the Bluetooth adapter and rebooting my headphones. From here, I "upgraded" to Windows 7 RC 32-bit, which worked OK with the Vista drivers for the D820. Audio connectivity was finicky, especially after rebooting, but I could usually get it working again just by removing and re-pairing my headphones. Next was my upgrade to the full release of Windows 7 (32bit). The same problems pretty much stuck around. My biggest issue was with a Windows Update driver that seemed to break A2DP, so I'd have to keep backing it out if I accidentally installed it. Unrelated instability issues with Win7 on the D820 led me to a new PC, the Latitude E6500.

So here I am, with brand-spanking new Dell Latitude E6500 with Windows 7 64-bit and a Dell Wireless 370 Bluetooth mini-card inside. Aside from the topic at hand, this didn't fix the stability issues, just FYI. The from-factory drivers for the Bluetooth adapter were version 6.2.1.100 A17, IIRC. When I look it up now, it shows up as Vista 64 driver. These drivers simply didn't work. They would pair with my Insignia NS-BTHDP headphones, create all sorts of devices in Device Manager, but no audio device would show up in the Sound control panel. Needless to say, audio never routed out to my head.

Next I tried downgrading to the 6.2.0.9600 A01 drivers, listed on Dell's support site as being for Win7 64bit. These would pair, work for an hour or so, then apparently crash. The Bluetooth icon would disappear from the taskbar, and audio would get re-routed to my hardwired desktop speakers. This happened multiple times, and re-installing the drivers didn't seem to help.

Currently I'm using the v6.2.1.800_7a drivers from Gateway's website (http://support.gateway.com/support/drivers/getFile.asp?id=24324&dscr=Broadcom%20Bluetooth%20Network%20Driver%20Version%206.2.1.800&uid=263953937). These seem to work OK, so far.I did notice today that I had to toggle the wireless switch to get the Bluetooth light to activate on my laptop. Once it lit up, it automatically re-connected to my headphones. I can live with this for now. Hopefully I don't see any more driver crashes.

Note that when re-installing these drivers, you should follow this procedure. Failure to do so can lead to some odd results in Device Manager, and total lack of Bluetooth functionality.

- Delete any paired devices (if possible)
- Clear pairings from your BT device
- Turn off the Wifi/BT switch on your laptop
- From "Programs and Features" control panel, uninstall the WIDCOMM or Dell Bluetooth drivers
- Reboot (DON'T SKIP THIS)
- Run the install for the new Bluetooth driver (v6.2.1.800 is my recommendation)
- When asked, flip the WiFi/BT switch back on.
- Reboot (just to be sure that the new driver takes)
- Pair your headphones

If you reboot/hibernate/suspend and find that the BT light is out, toggle the WiFi/BT switch.

Good luck!

UPDATE 4/2: Grr. It's still happening. Still looking for a solution...

Resolving a Persistent spoolsv.exe Error/Crash

Today I was troubleshooting a couple of network printers. One of them, I believed, had an incompatibility with "Standard TCP/IP" printing, via RAW communications. I tired other printer port options, including the HP TCP/IP port. I found out later on that the printer itself (a multifunction copier actually) did not have printing capability enabled. In the process of installing a printer driver later in the day, I ran into this error:

The instruction at "0x00000000" referenced memory at "0x00000000". The memory could not be "written".

The error wouldn't go away. Reboots did nothing. Clearing out all registry references of the printers and drivers that I had been troubleshooting did nothing. Deleting my printer drivers folder only made things worse (as you'll read later) Even a reverting to an earlier System Restore point failed. Finally, after finding tidbits of information online here and there, nothing with a complete solution, I tried removing this key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\HP Standard TCP IP port

I then restarted "Print Spooler" in the Services control panel (services.msc), and my Printer control panel finally displayed properly, without crash. Unfortunately for me, I then had to delete all my printers, as I had deleted all of my printer drivers and none of the installed printers were functional.

So if you run into this error, try deleting the key above before attempting anything else.

Rant: Linux vs Windows Expertise Availablility

Recently at work, we've been being "audited" by a firm to help us determine the cost of operations in our department, and how we measure up to other organizations of similar structure and size. One of the comments that came back to us is that we could potentially be saving on cost of ownership if we were running a Windows shop on the server side. The argument put forth is that Windows Server expertise is more prevalent, and therefore less expensive, whereas Linux is exotic, and therefore less expertise is available, and therefore the cost of Linux expertise is higher. The argument assumes of course that the cost of ownership would drop with Windows to the point of making it more affordable as a whole over time.

Personally, I don't buy it. I think this theory is based upon this idea that everyone runs Windows desktops (I admit that I do as well, for desktop support reasons), and Windows Server is just like Windows, therefore it's easier to administer a Windows Server over a Linux server because (and I know I'm exaggerating here) any old Joe can work Windows. Usually, when this assumption is made, it's false. I've seen guys mess around with Windows Server because they "just want to set up a server". Next thing they know, they've got broken pile of crap for a network. Setting up a server properly, whether it's Windows or Linux, requires expertise. Not that I discourage experimenting with either, I'm just saying that a person needs experience with the Server environment and paradigms in order to understand how to properly set up a server, and knowing Windows does not better qualify a person for that.

I would argue that Linux actually offers a lower cost of ownership in addition to the obvious up front cost (free) for one simple reason (though there are many): Scriptability. Take for example the need to create a new VPN tunnel from 100 different servers back to a secondary site (something I'm working on this very moment actually). On Windows Server with the builtin PPTP VPN clients, you would have to either connect to each system individually, create the connection, and set up the proper routing, if applicable, by hand. At best you could create a macro with something like AutoHotKey to help you do this, or even purchase some uber expensive tool for doing these sorts of replications. But even in those cases, I would challenge anyone to do it as quickly as I could with a handful of free command line tools in Linux. With one system that's been granted passwordless SSH to all of our branch servers, I can script pretty much any change to happen with a minimal of fuss, and more importantly, I can proceed to other tasks while this executes. Writing a change on 5 servers takes literally as long as writing a change for 50, or 500, all without a single mouse click.

Now that's scalability. I'd like to see that happen on Windows Server.

I've administered an organization with multiple Windows Servers. I know what a pain it is. It's a mess. Word to the wise: GUI's are for the desktop, not for the server. We're currently looking at switching from CommuniGate to Exchange at work, and I cringe at the thought. Administration will be a headache. I know this because I've admined Exchange. Everything is a kludge, and you can blame Microsoft for that. God forbid they follow an established industry standard once in a while.

</RANT>

Overcoming ODBC "Invalid character value" Error in UPS WorldShip

If you ever run into this error when trying to export data from UPS WorldShip:

ODBC ERROR: State = 22005 Error = [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification

...here's the solution. The "defout.mdb" file that exists on your source installation is corrupt. I'm assuming this, as what proceeds seems to solve the issue. In order to get a clean copy of this file, you need to create a address book on a new installation of UPS WorldShip (possibly on the machine you will be importing to) and export that address book on there. Then take the defout.mdb file from the new system, copy it to the old system, and retry the export on the old system. This time it should complete without failure.

Good luck!

Disabling the Shutdown Event Tracker (via Regedit)

Just quick post to help those of you out there who seem to be having problems finding the Shutdown Event Tracker setting in gpedit (as I did). To disable the shutdown event tracker, you need to add/edit these two keys:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability]
"ShutdownReasonUI"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability]
"ShutdownReasonOn"=dword:00000000

Or, if you prefer, here's a ready-to-use regedit file.

Crashes On Windows After PCAnywhere Is Installed

I thought I'd take a note of this just in case it comes in handy to anyone else out there.

A couple of weeks ago I installed PCAnywhere 10 on my laptop and when it asked me to reboot, I declined. The next day, after rebooting my computer, I noticed my resolutions were all messed up. It kept trying to show me aspect ratios that didn't match the LCD screen I have. It would also set my resolution to 800x600, or something similarly weak. Whenever I'd try changing it, the computer would crash, saying something like invalid page fault "Page fault in nonpaged area" with "STOP: 0x00000050". The DLL always listed as being implicated was "awvid5.dll". Upon some Google searching, I realized that PCAnywhere had messed my computer's video drivers up. I proceeded to uninstall PCAnywhere, and after rebooting, got my stable operation back.

One Cool Text Editor

I've been looking for a good text editor for a few years now. Yeah, I wasn't looking really hard, but I had tried a couple of the usual suspects, TextEdit and UltraEdit-32. Both seemed good if not great, but the nag screen thing bugged me. I also didn't like the idea of paying $30-40 for a text editor. I mean, the colors are cool and all when I'm editing Perl code, and I like the advanced search and replace features, but I don't think that I could justify spending $30 for that. I'll just use notepad and wordpad if it comes right down to it.

But in this last round of searching for a text editor, I found PSPad. It's excellent for the price (free). I may never make use of all of it's features, but for my purposes, it's perfect.

Make Your Windows(tm) Snap

One of the things I miss from using Linux on a daily basis is the ability to have my windows snap to the frame of other windows and the desktop itself. It helps to keep things organized and better utilize space.

I've found a tool that help you do this. allSnap. You should download it right now and check it out.

Microsoft's Vauge Errors

Did I mention I hate Microsoft. Hate is a strong word, I know. That's why I use it in this situation.

Today is the first day of my Memorial weekend vacation. I drove 6 hours to arrive at my destination at 3:00AM and went directly to bed. At 7:15, I get a call from work. "The Intranet isn't working". I'm tired. Really tired. But since I am the only IT guy at the company capable of troubleshooting such an outage, I have to get up. I have the caller look at the error in IE, but of course, all that comes up is the oh-so-useless "friendly" http error message.

"I'll take a look at it and give you a call back with an update". So I hop on the VPN and check out the Intranet page with Firefox (my default browser)...

Persits.AspUser.1 error '800a0020'
A device attached to the system is not functioning.

I log onto the Intranet server and quick look at the event log implies a disk block problem, but other than that, everything seems fine. On the face of it, you'd think the error means that some physical device on the computer has failed. However, a Google search says differently. The error implies that either a file is inaccessible or a file is corrupt, but it doesn't say what. Not even the IIS log file says anything usefull. So to attempt to get things running again, I re-install the Persits COM. No change. So I re-install Service Pack 4, thinking that some required file of IIS went corrupt due to the disk error. Nope. Still no change.

At 8:30 I get a call from work, this time someone can't log on to their own computer with his password or the domain admin user. WTF! Just what I need. Two serious problems at once. He really needs to get back on his machine, so I connect to the Active Directory master server via RDP. Guess what. I can't log in either. Something's f'ed up with the authentication server. So I tell him to reboot the server for me. Five minutes later, he's able to log in just fine.

Astoundingly, the intranet page starts working. I know now that the cause is the issue was that AspUser could not connect to the AD server, but WTF. That's one absolutely misleading and vauge error message.

Hate. Yes, that's the right word.

Changing the Default Power Profile on Windows 2000

At work we use Symantec Ghost to keep time re-installing user computers to a minimum. Part of achieving that goal is trying to reduce the number of unique images we have to keep up to date. For instance, we currently have 2 images for 7 different models of computers. One image in particular is set up to work on both our Compaq laptops and older Compaq desktops. To make sure that this image works on both machines, we have to load the image to both and re-dump the image back to the Ghostcast server after allowing the normal hardware discovery.

The other day I noticed that the power profile on the desktop machine was set to Portable/Laptop by default. Quite annoying when most people step away from their desks for 20 minutes or more on a regular basis. Guess what! That's by design according to Micorsoft KB247234 . To resolve this, most people seem to be suggesting that you copy a profile that has been set to use the Desktop power scheme to the Default User profile. I find this particularly messy. It copies lots of other things like system paths along with it. Bad idea. And Microsoft's solution is just plain weak: Manually select the power scheme.

A better alternative to this is to load the Default User registry hive and change the applicable registry entry. To do this...

  • Start --> Run.
  • Open regedt32 [Click OK]. Note the lack of "i" in regedt32.
  • Select the HKEY_USERS window.
  • Go to Registry --> Load Hive.
  • In C:\\\\Documents and Settings\\\\Default User , select and open the NTUSER.DAT file.
  • Set a Key Name of "Default User".
  • Under \\\\HKEY_USERS\\\\Default User\\\\Control Panel\\\\PowerCfg , open the key named CurrentPowerPolicy
  • Set the string to 0 instead of 1. [Click OK]
  • Select the HKEY_USERS\\\\Default User branch.
  • Go to Registry --> Unload Hive.

Thats it! All new profiles created will use Desktop as the default profile.

Why SQL Server Won't Log In

Have you ever changed the logon password for your SQL service account and found that the service no longer starts up after a reboot on it's own? You look through the event log and you see the error:

The service did not start due to a logon failure.

OR


The MSSQLSERVER service failed to start due to the following error:
The account name is invalid or does not exist, or the password is invalid for the account name specified.

But when you go into Services, re-enter the login info, and restart the service, it comes up just fine. Reboot and the problem comes right back.

I've seen this issue and dealt with it for years now, since the release of 2K, probably. It's really annoying because you have to manually restart the service every time you reboot. And of course the change never sticks. Guess what. In true Microsoft fashion, they put the login info elsewhere in the OS, and in this case, it overrides the Services tab login info.

To get the login info to stick, you have to right-click on the server instance in Enterprise Manager, select Properties, enter the security tab, and re-enter the account password here. This setting apparently overwrites the Services setting upon each reboot.


Thank God I won't have to babysit that server any more. All I have to says is: FINALLY!

Could Not Load otdll.dlo

This morning at work, shortly after an AVG virus scan had completed, one of our users got an error when opening nearly any application that the dynamically linked library otdll.dlo could not be found in the path. After futzing with it for 15 minutes, I was at a loss and decided to reboot. The graceful shutdown failed miserably with errors and bluescreens, but the machine eventually rebooted on it's own. But lo and behold, after it had rebooted everything came back to life and was healthy as normal.

Now, this by itself isn't all that odd. Windows does lots of screwy things that can't apparently be recovered from without a reboot. What was odd is that nowhere online could I find a reference to "otdll.dlo" and the file was, of course, nowhere to be found on the system. A now-removed virus maybe? Who knows. Just thought this might be useful information to someone out there.

Restart Now? Restart Later? How about 24 hours later?

Today Microsoft came out with patches for 7 bugs. I promptly applied them as usual, and got the usual nag screen afterwards...

And of course, 10 minutes later, the same message. If you look up "restart now restart later" on Google, you'll get lots of frustrated people talking about bad design in software, and how this dialog is really annoying for many reasons. Some places tell you how to disable it with gpedit.msc, but I've got a simpler solution. Just run my regedit file: Restart Later (24 hour nag).reg. Once you run this (and reboot to apply the change) you won't be nagged again for 24 hours. If you really don't want to reboot yet, you can restart the Windows Update Auto Update Client process. Just hit Ctrl+Atl+Del, click Task Manager, go to the Processes tab, and look for the image name "wuauclt.exe". Select this and click "End Process". This will kill the program that keeps nagging you, and Windows will automatically restart it in a minute with the changes applied.

Just keep in mind, you really should reboot sometime today, you probably just don't have to right now... or in 10 minutes... or 20... 30...

The Free One-Two Punch Against Spyware and Viruses

About a year ago I had pretty time-consuming battle with spyware, and from the spyware, viruses. I don't know if the version of Symantec AV was out of date or what (the updates still kept coming in, but so did the infections). And AdAware just wasn't cutting it with the free edition. I'll admit it: I'm cheap. I don't like having to pay for software. Personally, I'd just use Linux + Firefox, or even settle for Windows + Firefox, but most people that I help are still attached to their IE because of web developer stupidity/laziness.

But I think I found a combination of software that seems to knock out infections for good, at least in 95% of the cases. Some users still manage to get some nasty stuff installed, but that tends to be pretty rare now. The first part is to uninstall all that other overpriced antivirus software. Get it all off of there. As far as I'm concerned, it's crap compared to AVG, so you might as well get rid of it. AVG is faster, simpler, and free (to residential users). I've even had AVG catch and clean up stuff that Symantec and TrendMicro either missed or couldn't seem to get rid of. AVG still has it's occasional struggle, but that can usually be remedied by running it's scan in safe mode once. My only suggestion is to turn off the annoying email signatures that "certify" your mail as being virus-free. It's seems rather odd to me that a company would do this generate a mental response of "I can trust this message: It's already been scanned!", especially when all a virus needs to do is emulate the same signature to gain that same sense of trust in the recipient. Besides that, it's just more cruft to parse through when reading an email thread.

So that pretty much takes care of all the viruses, and even some spyware, but we still haven't knocked out the majority of it. I'd say most infections nowdays end up being spyware-related anyhow. As I said, I had been using AdAware, but the free product is insufficient for ongoing spyware control. I also tried Spyware Doctor, but that kinda had similar results, and also was handicapped freeware. I'd been impressed with Spybot S&D, but was finding that the definitions were quickly getting outdated and the machines would eventually get infected again.


Really, I loved Spybot, but I needed something that automatically updated and re-immunized the system on a somewhat regular basis. I did some research and found a command line that seems to do the trick. I now run that everytime the user logs in. Ever since, those machines have stayed spyware-free. I put the command line into a registry file that you can put on your own system: Spybot Search and Destroy AutoUpdate / AutoImmunize. Just download and run the .reg file to update your current installation (I'd suggest Spybot S&D 1.4 or higher) to keep itself up-to-date.

Outlook 2003 Printing Crash

Today I noticed that I could no longer print in Outlook 2003. It would keep coming up the with the error:

Line: 1343
Error: Unspecified Error

To resolve the problem, I had to run this:

Regsvr32.exe %Windir%System32Ole32.dll

If you run in to this, give that a shot and see if it fixes your issue. Props to Zaphood2003 for the solution.

Changing Account Usernames in Windows XP Home

Today I needed to change a user's username (not the displayed name) from "Owner" to first initial and last name concatenated (flastname). The normal WinXP Home control panel tools (at least the ones you can see) do not show this option, whereas XP Pro does. To change the account names, you must go to Start --> Run: control userpasswords2. Then from within this control panel, open the accout properties and change the "User name".


Just thought this might be helpful to someone else. God knows it's frustrating when Microsoft intentionally handicaps a product to charge less for it.

.NET Is A Piece Of S**t

Every few reboots of a server at work, I get this error and the only way I seem to be able to resolve it is to re-install .NET Framework...


"aspnet_wp.exe could not be started. The error code for the failure is 80070545. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account. "

It turns out I'm not the only one: 'Nuff said. Not to mention, the application is friggin slow as can be to load when it does work.

Microsoft Knows What's Good For You!

Microsoft is infalliable in their wisdom of proper software design. They know better than you how a program should be designed. At least that's the impression I get from the Windows Search tool. Yesterday, I spent at least an hour increasing my productivity by unsuccessfully attempting to find files that contained the string "email". I know there files were there because I happened upon one that contained it. Windows gave me no indication that there might be a reason why I was not finding the files I was looking for.


Apparently Microsoft improved the search feature by making it not look in all files when it says it's looking in "all files". It makes the descision for you that, unless it knows the files extension and type (.txt, .doc, etc), it won't search the file. That means any files you have created without an extension, or files that use non-Microsoft types (.sql, .cfg, .php, etc), it will ignore them without telling you. There are modifications that you can make to return Windows to it's expected, legacy behavior. The details are in KB Article 309173. But to save you time, I have created a registry script that will alter (fix) this setting for you. Windows XP Search Fix. Just download and run!