Solve the NSIS error

Solve the NSIS error

I was trying to install some software last week and I got an NSIS error. The message certainly suggests corrupt downloads, but corrupt downloads are relatively rare, and when they happen, redownloading it ought to clear that up. Getting two of these failures in a row with different programs is really a freak occurrence, so I started looking for another problem.

Read more

Share a Windows 10 printer by UNC

Windows 10 uses homegroups, but if you have systems that don’t understand homegroups and want to share a Windows 10 printer by UNC (the old school way to share a network printer), it’s not obvious how to go about doing it.

I couldn’t find a way from the GUI, but it’s still possible to share the printer from a command line.

Read more

Compress system files doesn’t show up in Disk Cleanup

One of the new features of Windows 10 is better file compression, which was intended to help Windows fit better in low-resource devices like tablets. But it’s helpful on computers with SSDs too. But for whatever reason that option doesn’t show up on mine.

But you can still compress your system files even if the Disk Cleanup utility (which you can also launch from the Free up disk space by deleting unnecessary files control panel) doesn’t show the Compress system files option.

Read more

Accessing the Programs and Features control panel app from the command line

From time to time I have to pull up Programs and Features (formerly known as Add and Remove Programs in obsolete versions of Windows), but I’m not an administrator. Not normally, at least. When I need to do so, I run cmd.exe using my administrative ID–I created a shortcut and pinned it to my Start Menu so I can right-click cmd.exe and select “Run As”–and then, from the command prompt, I type appwiz.cpl. Then I can make all the changes I need to make, without the hazards associated with logging in as an administrator and running everything with admin rights.

CMD.EXE and its shellshock-like qualities

“So did you know there’s a Windows version of Shellshock?” a coworker asked the other day.

“What, Cygwin’s bash?” I asked.

“No, in CMD.EXE.”

I thought for a second, back to some really nasty batch files I’ve seen that do goofy stuff with variables and parenthesis and other reserved characters. Suddenly it made sense. Those cryptic batch files are exploiting the command interpreter to do things that shouldn’t be done. Then I smiled.

Read more

Revisiting Microsoft/Sysinternals Du as a batch file

My tips for using Sysinternals’ Du.exe were well received last week, and my former coworker Charlie mentioned a GUI tool called Windirstat that I had completely forgotten about. For the command-line averse, it’s an incredibly useful tool.

But there’s one thing that Du.exe does that makes the CLI worthwhile. It will output to CSV files for further analysis. Here’s the trick.

DU -L 1 -Q -C \\SERVERNAME\C$\ >> servers.csv

Sub in the name of your server for servername. You have to have admin rights on the server to run this, of course.

For even more power, run this in a batch file containing multiple commands to query multiple servers, say, in your runup to Patch Tuesday. Open the file in your favorite spreadsheet, sort on Directory Size, and you can find candidates for cleanup.

Read more

How to use Sticky Keys to change/unlock a forgotten password

This isn’t a particularly new trick, nor did I invent it. But it’s a good trick for breaking into a Windows system when you don’t have a lot of tools at your disposal, and have legitimate reason to do so–like a lost or forgotten local administrator password. I’ve talked about some of those reasons before. I’d also add someone locking themselves out of their own computer to the list. It happens, just like people locking themselves out of their cars, or their houses.

Not every writeup I’ve seen of this trick goes into what I would call sufficient detail. So I’ll take a shot at it.

Read more

How to use compression to help life with an SSD

Since pretty much everyone thinks my love of SSDs is insane, I’ll throw another insane idea on top of it: using data compression. It makes sense. Doing it selectively, you help performance, while saving space. At a much higher cost per gig, that saved space is very nice to have.

Here’s why compression makes sense. Under many circumstances, an SSD can saturate your IDE bus. Then you run into the 56K modem problem. The bus is saturated, but you want more speed, so what do you do? Compress the data. Although data compression makes people nervous (shades of DoubleSpace I’m sure), modems have been doing this for two decades. Why? Because it works.

So while your drive is happily shoving 200 megs per second through your IDE bus, if you can compress that file by 20 percent, guess what? You’ll get 20% better throughput.

CPU usage is the main objection to this. But in my experience, NTFS compression uses 20-40% of a recent (P4-class or newer) CPU when compressing. That’s the hard part. When decompressing, overhead is a lot less. The objections to NTFS compression really date to the days when 200 MHz was a fast CPU.

I don’t recommend just compressing your whole disk. Selective compression is a lot better. There’s no use trying to compress data that’s already compressed, and a lot of our data is.

Use the command COMPACT to do the job for you. Here’s my sequence of commands:

CD \
COMPACT /S /C *.doc *.xls *.rtf *.txt *.1st *.log readme* *.bmp *.wav *.wmf *.bat *.cmd *.htm *.html *.xml *.css *.hlp *.chm *.inf *.pnf *.cat

If you have other compressible files, of course you can add those.

This is a one-time event, but you can schedule it to happen daily or weekly if you want. Just put the two lines in a batch file and create a scheduled task to run it. The command will skip any files that are already compressed. While the compression itself doesn’t take a lot of CPU time, scanning the drive does, so you might want to run it while you’re away if you’re going to schedule it.

Don’t bother trying to compress your My Music or My Pictures directories; that data is all highly compressed already, so all you do is tax your CPU for no reason when you compress that kind of data. Of course the main reason people buy 1 TB drives is because they have hundreds of gigabytes of music and movie files. It’ll be a while before storing that kind of data on SSD is practical. In that case, buy an SSD to hold the operating system and apps, and a conventional drive to hold all that data.

Some people compress their C:\Program Files directory. This can work, but some programs are already compressed. I would be more inclined to experiment with subdirectories on a case-by-case basis. Try compressing one program directory, see if it packs down any, and if it does, great. If not, uncompress it and move on.

UPX does an outstanding job of packing down program files but it’s not completely transparent. I found enough programs didn’t run afterward that I gave up on it. NTFS compression is a lot less effective, but a lot more transparent. As long as you don’t compress your swap file or hibernation file (and Windows will warn you incessantly if you even try to do that), you won’t break anything with it.

If you enjoy tinkering with things, by all means feel free to experiment with UPX. There was a time when I would have probably done it, but given a choice today between playing with data compression or playing with metalworking tools, I’d rather play with my metalworking tools.

But I do really like this SSD. For the first time in a very long time, I can sit down at a computer running modern software and it still feels fast.

The Compaq DL320 and Ghost

We got another Compaq Proliant DL320 in at work. This one’s a Windows 2000 print server (grumble grumble–we’ve been playing with HP’s Linux-based print appliances and so far I really like them).

But anyway, since rebuilding a Windows server is a much bigger deal than rebuilding a Linux server (all our other DL320s run Debian Linux), we tried building a recovery image with Ghost.

Only one problem: Ghost 7.5 doesn’t see the DL320’s IDE drives. DOS sees them just fine. But Ghost 7.5 doesn’t see them, and neither did MBRWork, a freeware partition-recovery tool that’s saved my bacon a few times. There’s something odd going on here.

In desperation, I dug out an old copy of Ghost 5.1c I found on our network. It’s from mid-1999. Oddly enough, 5.1c sees the Proliant’s CMD 649-based UDMA controller just fine. The only problem is, Ghost 5.1c doesn’t handle the changes Windows 2000 made to NTFS. It’ll make the image just fine, but when I went to try to restore it, Ghost crashed.

So I pulled out an unused copy of PowerQuest Drive Image. Drive Image worked fine. Mostly. It made the image at least. One thing I noticed was that Drive Image’s compression was a whole lot less effective than Ghost’s. The other thing I noticed was that Drive Image’s partition resizing didn’t work right. I’d re-size the partitions so they’d fit on another drive I had (I wanted to test the backup to make sure it worked, but not on the live, production drive) but no matter what I did, it reported there wasn’t enough room on the drive.

“Ghost would be so much better in every way, if it worked,” I said in frustration.

“Isn’t that true of everything?” Charlie asked. I guess he didn’t think that was the most brilliant observation I ever made. Not that I did either.

We’ve got support with both Symantec and HP, so we really ought to call them and see if they have a resolution. HP talks out of both sides of its mouth; on the one hand, I found statements on its Web site that Ghost is unsupported on Proliant hardware, and on the other I found some tools that claim to help with system deployment using Ghost.

But since this DL320 is being used to drive a printer that costs about as much as any of us make in a year, and it’s being set up by a guy who’s being flown in early this week at $2,000 a day, I’m not positive that we’re going to get a good resolution to this. I suspect we’ll just end up using Drive Image and keeping an identical drive on hand in case Windows 2000 gets suicidal on us. The price of an IDE drive is pocket change on top of all this.

But when you’re running Linux and GNU tar is a legitimate option as a backup and recovery tool, I love the DL320. It’s small, fast, and cheap. It’s funny when tools allegedly written by college students as a hobby work better and more consistently than commercial tools you have to pay for.

Well, I guess I should say it’s funny when that happens and it’s someone else who has to deal with it.

R.I.P.: One W2K box

My video editing box bit the dust earlier this week. I loaded a rather large image into Photoshop LE, and it hung. I killed Photoshop LE, and all appeared to be well. Then the desktop and Start menu went away. A few seconds later, they reappeared. They went away again, then reappeared. The cycle continued like a beating drum.
So I did what you should always do when a Windows box starts acting goofy: Reboot. And? After logging in, the problem reappeared.

So I scanned for viruses. The system was clean. I found that if I killed explorer.exe, everything else ran fine. So I could run programs from Task Manager, bring up a command line (just run cmd.exe) or bring up the old Program Manager (remember that from the worse-than-awful Windows 3.1?) and run programs that way. It’s a safe and easy way to save memory, but I really don’t care to subject myself to it on a regular basis. Explorer isn’t perfect, but Program Manager might be the worst shell I’ve ever seen. And I fear that if Explorer is constantly crashing, there’s probably something else wrong with the installation.

I tried doing a recovery install. No go. The installation media couldn’t find a Windows installation on the disk. Figures.

I don’t know if I have a Ghost image of this machine, which is a major pain. W2K got along just fine with all the hardware in the machine, but when I added the Pinnacle DV500, it took me a really long time to get it working right.

So I’m not sure what I’m going to do.