Friday, September 23, 2011

geeky tip-of-the-day

Some months ago, I built a project for a client that pushes Access data into a SQL Server database. For development, I installed SQL Server Express and it worked great.

Now another client needs something quite similar so I went to start up the SQL Server Express service and Windows said "sorry, I can't start it." A check of the Event Viewer revealed a couple of files that had been compressed, the last time I ran the 'Disk Cleanup' function, and SQL Server could not deal with those (critical) data files being compressed.

So, the problem is how to decompress files that have been compressed by Disk Cleanup. No, you can't use WinZip!

It took 20 minutes of internet searching until I found a thread discussing this, where one guy casually posted the following in a long list of comments:

1). Click Start
2). Click Run and type “cmd” to open a command prompt
3). Type “cd \” at the prompt to goto the root directory
4). Type “compact /u /s /a /q /i *.*” to decompress all files in all directories
You can run that command in ANY directory and it will decompress.

It took a while to use the DOS window to drill down to the appropriate directory (I always have to lookup the parm for showing the 8.3 names (dir /x), but I pasted in the above command, there was a heart-stopping pause of about a minute, then an 'all files decompressed' message.

Voila - the Service started up as normal and I am off and running. It's weird things like this that suck up an hour here and there, when you're trying to get real work done.

No comments: