Sunday, August 10, 2008

Bonjour Error when Connecting to a Mac Printer via XP

I reimaged my PC recently, and I have gradually been reinstalling everything I need. Before the reimaging, I had used Apple’s Bonjour for Windows to quickly and easily connect wirelessly to the Brother printer connected to my brother’s Mac.

However, today I spent hours trying to get the printer connected and then surfing for troubleshooting information. The error message Bonjour displayed was, “You do not have sufficient access to your computer to connect to the selected printer.” This error message is apparently normally caused by the PC local security policy for “Devices: Prevent users from installing printer drivers.” My policy was set correctly set to “Disabled,” though.

My brother couldn’t find anything to try changing on his Mac, and it didn’t make sense that the problem was there since we had this working before I reimaged my PC.

However, we decided to try something I found on the web anyway, and it worked. My brother said that step 6 was the key: ‘6) Mac: Set firewall to "Set access for specific services and applications."’

Thursday, August 7, 2008

Automatically end processes when shutting down

My PC was running really slow this morning, so I decided to restart it. Shutting down took forever because I was prompted to end each task one by one. Before I reimaged the hard disk on my PC, I had edited the registry to automatically end tasks at shutdown. Today it took me so long to find what to edit again that I decided this needed to be in my PC notes.

You should know what you’re doing before you edit the registry, since you can really mess things up if you make a mistake. I backed up my registry and then changed HKEY_CURRENT_USER\Control Panel\Desktop\AutoEndTasks to 1.

Below are some related Microsoft links.

Friday, July 18, 2008

Updated AutoRun to Open USB Drive Folder

My solution from yesterday (AutoRun to Deal with USB External Drive "Delayed Write Failed" Problem) was too irritating. I'd double-click on the drive in the Windows Explorer and the power saver utility would run instead of opening a folder of the drive contents.

So I changed the AUTORUN.INF file to run a batch file that opens the folder and runs the power saver. Here are the new contents of the AUTORUN.INF file.
[autorun]
;open=Kathys_Autorun.bat
ShellExecute=Kathys_Autorun.bat
Label=Tim's 500 GB USB External Drive

Here are the contents of the called batch file, Kathys_Autorun.bat. (In the first "paragraph," each line begins with "echo." I'm not going to bother dealing with the word wrap that is happening on the blog page.)
echo off
echo Turn off standby (e.g., switch to the PRESENTATION mode of POWER SAVER)
echo while using an external USB drive to prevent going into standby and
echo thus causing DELAYED WRITE FAILURES.
echo .
echo Better yet, remember to EJECT the USB drive when you are done with it.

REM Bring up an Explorer window for the USB drive.
echo .
echo (1 of 2) Ready to open an Explorer window.
pause
start explorer.exe /select,Kathys_Autorun.bat

REM First try running the Toshiba Power Saver.
REM If that fails, try the Windows Power Saver.
echo .
echo (2 of 2) Ready to run Power Saver.
pause
control.exe TPwrSave.cpl
if %errorlevel% 1 start powercfg.exe /setactive presentation

The batch file displays a message, opens the USB drive folder in explorer, and starts the power saver utility.

I added something to run the Windows power saver if the Toshiba one fails to start. Hopefully someone will let me know if that works.

Thursday, July 17, 2008

AutoRun to Deal with USB External Drive "Delayed Write Failed" Problem

Some time ago, I got a 500 GB USB external drive. At last I could put all my photos in one place. I invested a considerable amount of time using Beyond Compare (which I love) and its Picture Viewer plug-in to get the best version of all my digital photos in one place. Yippee!

That joy was not long-lived, though. I started seeing file error pop-ups from the system tray, and when I saw one that mentioned the MFT, I became alarmed. The Event Viewer showed delayed write failures.

I ran many, many chkdsks before I got a clean one on my C drive. It didn't take many runs to get a clean one on the USB drive. I surfed for a solution to the delayed write problem. The solution that looked best to me--connecting by some means other than the USB cable--wasn't an option. I stopped using the USB drive.

Time passed, and my PC needed to be reimaged. (I'll have to do another post about that.) I copied all the data I wanted to save to my friend Tim's 500 GB USB external drive. After recovering the factory image to my PC's hard drive, I copied certain files from the USB drive back to my C drive, and things looked good.

That is, things looked good until one night I left the external USB hard drive attached, restarted my computer, and let it go into standby. The next morning, I saw two delayed write failure messages for files on the USB drive. The Event Viewer showed that the errors occurred before I logged into Windows.

To my surprise, the Event Viewer showed that the delayed write failures occurred not during the night but when I brought the computer out of standby. (Previously I had seen failures when I was doing large file transfers--moving lots of high-resolution photos.)

I decided that I would no longer allow the PC to go into standby with the USB drive attached. Tim had already come to the conclusion that it's best to eject external firewire drives whenever they are not in use, after he had similar problems with a firewire connection while working on videos. I wanted to prevent accidentally letting my PC go into standby with the USB drive attached.

The first job was to find out how to detect that the external USB drive was attached. After looking at an MSDN article, I decided to use the AUTORUN.INF file. Wikipedia Autorun information also helped.

Next up was to figure out how to disable standby mode, which I normally want enabled. I think most PC users could use the powercfg.exe command line options to disable standby.

However, I have a Toshiba Portege M200, so that didn't work. I have to use the Toshiba Power Saver utility, which is a Control Panel applet. Some surfing revealed how to run a Control Panel applet from the command line. Searching in C:\WINDOWS\system32, I found TPwrSave.cpl, which had the same icon as the Toshiba Power Saver utility.

(I installed TweakUI, but I don't think it meets my needs for this.)

Putting these all together resulted in an AUTORUN.INF text file, containing the following, saved in the top-level directory of the external USB drive. (I hope you don't mind me tailoring to my PC, Tim!)

[autorun]
;open=control.exe /TPwrSave.cpl
ShellExecute=control.exe /TPwrSave.cpl
Label=Tim's 500 GB USB External Drive
UseAutoPlay=1


I would have preferred that the power saver utility come up without having to cancel autoplay and select from the autoplay menu. I also wish I could have used a command line program rather than a GUI applet. I know there's more I could do, but I think I've spent enough time on this today.

If you have a better solution, or have something to add, please comment!