Insufficient Disk Space Warning When Attempting to install

Quick easy fix for Insufficient Disk Space Warning When Attempting to Unpack and Install a Sage ACT! Update or Hot Fix. The error arises from the fact that the free space on the drive is a multiple of 4GB. The underlying issue is to do with a bug in InstallShield. To fix this create a file of 1GB, changing your free space available, to do so quickly, from a windows command prompt, on the drive affected run this command:

fsutil file createnew 1gbfile.bin 1024000

This creates a 1GB file. You no longer have free space that is a multiple of 4GB. Do the install, then delete the 1gbfile.bin file. More on fsutil on Technet.

Windows Off-screen

Just had another client puzzled by this issue, their IT provider couldn’t figure out what was wrong either. The application (in this instance ACT!) appeared to start, but wasn’t visible. Ultimately, the window was off screen. They had used an external monitor and had been using the app on that second screen. They’d shutdown, removed the external monitor, now the app was not ‘there’ even tho it was in the windows task bar.

The solution? ALT-Space | Down Arrow | Enter | use the arrow keys to reposition the window onto the current active screen. Or use this utility: Sheepdog to do it for you.

Window Key + Arrow Key

If you’re using Windows 7, have you tried pressing the ‘Windows’ key and either the left or right arrow key at the same time?

What this does is ‘half screen’ your current application window. This is particularly useful on larger screens. For example I can have a reference document occupy the left half of the screen and write an email in the right half. This works on dual screens as well.

Sheepdog rounds up windows

One of the tools I’ve found very useful is SheepDog. Like the real world sheep dogs, it rounds things up, in this case stray windows.

Working with a laptop, I often plugin a second monitor, however, when I next fire up the laptop, windows may open up but not be visible on my laptop screen, they ‘remember’ that they were placed on the second screen, which is no longer connected. SheepDog rounds them up and moves them back to my primary monitor.

If you’re using a laptop or netbook, I recommend you take a look at it.

Using registry values in scripts

I’m often writing scripts to do stuff. It makes my job easier. I’ve often wanted to be able to script the discovery of registry values in the Windows Registry.

Thus here is a short example on using the vanilla windows command line to find the value of a Windows registry key. From my testing these commands are all present by default in Windows XP, Vista, 7, Server 2003 and Server 2008.

Assume we want to find the Microsoft Windows Common Files directory. Using `Regedit` we can find that here: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir`

So the first thing we want to do is query the registry, we do that with the command line tool `reg` as follows ([more about reg][]):

[more about reg]:http://www.petri.co.il/reg_command_in_windows_xp.htm
“Read up on how to use the reg command for more than just a query”

`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp`

This will spit out the following into the text file `1.tmp`:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
CommonFilesDir REG_SZ C:\Program Files\Common Files

However, this isn’t of much use in a script. Really, we just want the value of the folder itself, not all the extra info.

So what we do is use the command line tool ‘findstr’ which essentially is a windows regex tool ([more about findstr][]). We use it to do this:

[more about findstr]:http://www.netexpertise.eu/en/windows/findstr-an-alternative-to-grep.html
“Read up on findstr – regex goodness on windows by default”

`findstr /r REG_SZ 1.tmp >2.tmp`

This spits out just the line that contains REG_SZ and puts it into the text file `2.tmp`. Now that we’ve just just the one line, we want to strip the first 32 characters off it. We do this by first setting it as an enviroment variale and then trimming it down using the following two commands ([more on set][]):

[more on set]:http://www.computing.net/answers/windows-2000/use-file-contents-to-set-variables/63174.html
“Using file contents to set enviroment variables”

`set /p CommFiles=<2.tmp` And then we shorten that ([more on trimming][]): [more on trimming]:http://www.dostips.com/DtTipsStringManipulation.php "Read up on using set to trim environment variables" `set CommFiles=%CommFiles:~32%` Then we can echo the result to the screen using: `Echo The Common Files directory is: %CommFiles%` And here it is all in one easy to copy set: --- Set CommFiles=C:\Temp reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp
findstr /r REG_SZ 1.tmp >2.tmp
set /p CommFiles=<2.tmp set CommFiles=%CommFiles:~32% Echo The Common Files directory is: %CommFiles% --- With a little editing I'm sure that you can turn this to your own uses, pulling out the value of registry keys and using them in script files. You're not limited to this registry key, you can use it to access all sorts of registry keys. Please do tell me what uses you put this to. Enjoy.

Finding user SID

Occasionally you may want to know the [SID][] of a windows user. If that made no sense to you, read no futher, this snippet is not for you.

[SID]:http://encyclopedia.thefreedictionary.com/Security+Identifier
“Read a definition of what the SID is”

Open up REGEDIT and browse to this key:

`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList`

Here you will find a list of SID’s, under each is a subkey containing the name of the user it is associated with. Run through them until you find the username you’re looking for and bingo, it’s parent key is that users SID.

Found via [petri.co.il][]

[petri.co.il]:http://www.petri.co.il/forums/showthread.php?t=21332\
“petri.co.il is a wealth of tech goodness”

[Bonus link][]

[Bonus link]:https://secure.wikimedia.org/wikipedia/en/wiki/Security_Identifier
“More explaination of SID’s, decoding them etc”