There is an updated post on this topic available: Deleting local or network printers as well as printer drivers from the command line
Thursday, March 18, 2010
Deleting printers from the command line
There is an updated post on this topic available: Deleting local or network printers as well as printer drivers from the command line
Wednesday, March 4, 2009
Creating a self-signed certificate for SSL
However, if you only want to test something a self-signed certificate will also do the trick. The only drawback: Since it's self-signed, user will get a certificate warning when connecting to the server. For test environment however, this should be okay.
I'm using the MAKECERT.EXE command from Visual Studio for this. The command to create the cert is as follows:
"%ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\makecert" -r -pe -n "CN=my-server.corp.acme.com" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12
@echo.
@echo Now start mmc.exe, add the snap-in "Certificates" and
@echo acceess the certificate store of the local computer.
@echo Below "My certificates" the newly create certifcate will be located!
@echo.
pause
Once this command has completed, open MMC.EXE, add the "Certificates" snap-in, select "Local computer" as the scope and the newly created certificate will be inside the "My certificates" folder.
Enjoy!
Monday, February 2, 2009
Calculating when an integer identity column will be exhausted
In particular, we were discussing one table that we expecting to have one to two new rows per second each day. The customer wanted to define the identity as bigint, while we said that integer (int) is enough and faster for sure. What would you think how long it takes until an integer column as identity will "explode" on this table? Two Month? Three Years?
Well, if we calculate with three changes per second it would actually take 23 years!

In case you find this Excel file useful, you can download it here.
Thursday, September 4, 2008
Mozilla Firefox in "Jelly mode"
In case your are using a Netbook with an Solid-state drive (SSD), like the Asus EeePC 901, you will notice that Firefox 3 from time to time behaves like being in "jelly mode": it stops responding for a few seconds and simply freezes. Although this "jelly mode" will only last a few seconds, it will drive you mad if you try to use it for more than five minutes. Fortunately this can be fixed with some easy tricks and less than 10 minutes of time.
We got reports about this issue from several users of X-Setup Pro and they all asked us if there is a way to make Firefox faster and get rid of this jelly mode. Since we couldn't explain why this would happen, and we wanted to test X-Setup Pro on a netbook anyway, we bought a EeePC 901. After doing the typical "original setup, driver download and install, Windows Update check" procedure we installed Firefox 3.01 and within the first five minutes we were experiencing the jelly mode as well.
With the help of Process Monitor, DriveGLEAM, Wikipedia and mozillaZine we are pretty sure what this is causing. While using Firefox, it will perform a lot of small write operations to several SQlite databases (e.g. urlclassifier2.sqlite or places.sqlite) and other files like configuration files of add-ons or files for the cache. While this is fine with a normal HD, this causes a lot of stress for an SSD. SSDs are fast when reading data but very slow when writing. Although Firefox will only perform small write operations the SSD is not fast enough to perform this in time and causing Firefox to wait. And this is exactly what we are calling the "Firefox jelly mode".
The solution is quite simple: Move the Firefox profile (where all these write operations take place) to a location that is faster. But: The EeePC 901 only has two SSDs (C: and D:) plus an SD slot, meaning that there is no fast location available. This means, the only solution that is left is a RAM disk. The people at My Digital Life have written about this some weeks ago and made a package we can use right away.
Download the package and extract it to a folder on your HD (SSD), e.g. C:\ProgramFiles\RamDisk. From there, start RAMDISK.exe and click on the right on Install Ramdisk.
After a few seconds, the controls on the left will be selectable and we can choose which size this RAM disk should have. Since the 901 I'm using has 2 GB of memory, I selected 128M (128 MB) for size, if you netbook as only 1 GB, you might want to use 64 MB. All other settings (Drive: R:, Fixed Media) remain unchanged. Click OK and the program should report Success.
The next thing we need to do is to prepare the RAM disk, since it is currently set to use FAT instead of NTFS. Create a new Batch file in the same folder where RAMDISK.exe is located and name it Setup.bat. This batch will create some folders and save the image (with the folders) to the registry. Since we are using a RAM disk, rebooting the computer will wipe the entire contents of the R: drive. With the batch, we are creating an image of the drive and store it to the registry. When the computer is booted, the RAM disk is re-created from this image automatically.
@echo off
echo This will setup the RAM Disk
pause
format /FS:NTFS /Q /V:RamDisk /A:512 R:
chkdsk /L:2048 R:
CACLS R:\ /G Administrators:F
MKDIR R:\TEMP
MKDIR R:\FFCache
MKDIR R:\IECache
MKDIR R:\Stuff
rdutil R: registry
pause
Execute the batch. Press return to get things rolling, then enter RamDisk to confirm you want to format the R: drive, confirm the format again (Y) and once again (Y). If you now open Explorer, you should have an R: drive with several folder in it. Please note: If you ever change your mind about the size of the RAM disk and change it using RAMDisk.exe you need to execute this batch again!
Next, we need to create a profile in Firefox that will be stored on the RAM disk. Using Explorer, open R:, change to the folder Stuff and create a new folder named RamDiskProfile. Now open a command prompt (Start - Run - cmd.exe) and change to the path where Firefox is installed, e.g. cd "c:\program files\Mozilla Firefox". Execute firefox.exe -ProfileManager. Click on New profile and enter as name RamDiskProfile. As folder, select R:\Stuff\RamDiskProfile. Back in the profile selection, click Start Firefox.
If everything works as expected, you should see the Welcome to Firefox page. Notice: Do not, repeat, DO NOT copy your existing profile! At least on my 901, several files inside the profile had direct likes in it (e.g. C:\Documents and Settings\TeX HeX\...). If you simply copy your existing profile you will end up having some of the files will be written on the SSD again.
What we now need to do is to change the location where this Firefox profile will put the cache files to. In the address bar, type about:config and confirm the warning that appears. Right-click anywhere in the list and select New -> String. As name of the new value type browser.cache.disk.parent_directory. As value for it, type R:\FFCache. Close Firefox.
Now we will create a backup of this profile to the SSD. Use Start -> Run again and type %APPDATA%, which will display the folder where your personal data is normally saved. Open the folder Mozilla, then Firefox and then Profiles. Copy the folder R:\Stuff\RamDiskProfile there.
Okay, we are almost there. Create a new batch file that is used to start Firefox with the profile from the RAM disk. It will copy the files from the RamDiskProfile (from %APPDATA%) to the R: drive, wait for Firefox to exit (= you are done with browsing) and copy then any files that were changed back to %APPDATA%.
@echo off
echo.
echo Launching Firefox from RAM disk...
echo.
IF NOT EXIST R:\Stuff\RamDiskProfile\. mkdir R:\Stuff\RamDiskProfile
REM The xcopy command is one line until the "cd" command
xcopy "%APPDATA%\Mozilla\Firefox\Profiles\RamDiskProfile\*.*" "R:\Stuff\RamDiskProfile" /S /I /Y /H /Q
cd /D "R:\Stuff\RamDiskProfile"
attrib -a *.* /S
echo.
echo Firefox launched, this window will close when Firefox is closed
start /wait "Firefox from RAM disk" "%ProgramFiles%\Mozilla Firefox\firefox.exe" -profile R:\Stuff\RamDiskProfile
echo.
echo Copying files back from RAM disk...
REM The xcopy command is one line
xcopy "R:\Stuff\RamDiskProfile\*.*" "%APPDATA%\Mozilla\Firefox\Profiles\RamDiskProfile" /S /I /Y /H /Q /M
Now you also know why we have changed the location of the cache files earlier on: Because the cache files are now longer part of the profile (but instead on R:\FFCache), they don't need to be copied back. Of course, if you want to have your cache persistent, you can easily delete the browser.cache.disk.parent_directory from about:config and the cache files will be copied as well.
Start the batch file and give it a try, I'm pretty sure you will think you have just got a new computer. No more jelly mode, and the speed is what you were expecting from Firefox.
To verify that everything has worked, type about:cache into the address bar and look at the two cache directories, both should be pointing to R. One thing you need to keep in mind: In case you install an add-in or a theme, Firefox is offering to restart it with a single click. Don't do this since the batch will close when Firefox exists. Simply close it manually and restart it again using the batch.
Some other things you can do with the RAM disk: There is already a folder called TEMP so you can simply reconfigure your environment variables TEMP and TMP to use this folder. And finally, the folder IECache can be used to put the temporary internet files there.
Enjoy!
Sunday, June 1, 2008
Asterisk Dialer
I have tested several options and programs that allow you to do this, and the best I found so far is the Asterisk Outlook Dialer (Freeware!).
It contains of a small PHP file you install on the Asterisk server and a local extension that integrates into Office Outlook (tested successfully with Office Outlook 2007). Entering a number into the box and hitting Dial will call the PHP file which in turns informs Asterisk to call your phone and connect you.
You only need to change the PHP file (originate.php) to include a context, username and password that can perform the actions on Asterisk. For example:$sContext = "from-internal";
$UserName="AstTapi";
$Password = "D1QdC1xbkJ";
Once you have installed the extension, you need to configure it directly in Outlook using Tools -> Options -> Asterisk Dialer
The only glitch I have found was that non numeric chars inside the number (e.g. “+49..”) will cause the call to fail. Therefore you should patch the PHP file a little bit more.Replace the part where you need to enter the context, username and password with the following:
//Number patching
$sNumber = preg_replace("/[^\+0-9]/", "", $sNumber);
$sNumber = str_replace("+49", "00", $sNumber);
$sNumber = str_replace("+", "000", $sNumber);
//User information
$sContext = "from-internal";
$UserName="AstTapi";
$Password = "D1QdC1xbkJ";
This line will strip out any chars that are not either numbers or the “+” sign. That way a number like “+49 (6232) 3987-x312” will become “+4962323987312”.
The next two lines will change the number as required by the backend PBX. A call from Germany to Germany needs to be initiated with “00”, a call to any other country needs to be initiated with “000”. You might need to change these two lines to meet your requirements.
In case you wish to mass deploy this extension, simply perform a normal installation on a given computer and enter the URL of the PHP file directly inside the setup (e.g. http://trixbox1.corp.acme.com/originate.php). Once setup has finished, copy “AsteriskDialer.dll” and “AsteriskDialer.ini” to any network folder. Inside that folder create a batch file with the following content:
md "%ProgramFiles%\AsteriskDialer"
copy "%~dp0AsteriskDialer.dll" "%ProgramFiles%\AsteriskDialer" /Y
copy "%~dp0AsteriskDialer.ini" "%ProgramFiles%\AsteriskDialer" /Y
regsvr32.exe "%ProgramFiles%\AsteriskDialer\AsteriskDialer.dll" /s
reg add HKLM\Software\AsteriskDialer /v IniFilePath /t REG_SZ /d "%ProgramFiles%\AsteriskDialer\AsteriskDialer.ini" /f
And that’s it!
Friday, February 8, 2008
XQGetOSVer 3.0 available
XQGetOSVer returns a number for each detected OS (Windows 95 up to Windows Server 2008) and can therefore easily be used for batch files where you want to execute special commands depending on the OS in use.
Friday, November 2, 2007
Screen Zoom Tool
A great zoom utility is ZoomIt by the SysInternals guys (now also Microsoft) as I found out today. I note this utility here because it's not only very simple to use but you can also draw on the zoomed area with your mouse to easily highlight a button or function. And if this is not enough, you can also type text into the zoomed area.
Best of all, it's free.
Friday, September 7, 2007
Nice mouse tool - Pitaschio
Basically, it allows you to configure mouse action to several functions. For example, you can configure that a wheel click on the title bar of a window minimizes it. Or, if you use the wheel on the title bar the window becomes transparent so you can view what is behind.
Beside this, it can also lock several keys like Caps Lock or the Windows key (good for Crysis :-).
Saturday, July 7, 2007
HP Bluetooth with Microsoft Bluetooth Stack
I usually prefer to use the Microsoft Bluetooth stack (included with Windows XP SP2) instead of the WIDCOMM stack because it requires less recourse, is faster and also easier to use. The only thing missing is support for any Audio profile.
However, if you have a lot of HP notebooks or tablets, you normally can't use the Microsoft stack since it doesn't know the build-in "HP integrated module with Bluetooth wireless technology". But there is a way to do it anyway…
First, remove the WIDCOMM stack using Control Panel -> Add/Remove Programs. Next, restart you computer and open up "Device Manager" (execute Devmgmt.msc). The above noted device will appear as "Unknown device".
Next, open C:\WINDOWS\inf and open the file "BTH.inf" with Notepad. It will start with something like this:
; Microsoft Windows Bluetooth Driver INF
; Copyright (c) 2002 Microsoft Corporation
[HP.NT.5.1]
"HP USB BT Transceiver [1.2]"= BthUsb, USB\Vid_03F0&Pid_0C24
Duplicate the last line and append it so it then looks like this:
[HP.NT.5.1]
"HP USB BT Transceiver [1.2]"= BthUsb, USB\Vid_03F0&Pid_0C24
"HP USB BT Transceiver [Patched]"= BthUsb, USB\Vid_03F0&Pid_011D
Note that we only have changed the last characters to the PID (Product ID) of the Bluetooth device. If you have a new laptop the PID might have changed. You can get this PID by double-clicking the device and using the details tab.
Save the BTH.INF, go back to Device Manager and select "Scan for Hardware changes". The device should now start to install. It might happen that the device is after reported as having a problem. If this happens, simple right-click it, select "Disable" and after that "Enable" again.
That should do the trick and you can use the Microsoft stack with the "HP integrated module with Bluetooth wireless technology".
Enjoy!
Saturday, June 9, 2007
Core 2 CPU Tools
Most people would recommend something like RightMark CPU Clock Utility for displaying the CPU temperature and Prime95 for stress testing. Only a few people seem to know that Matthias Withopf has created two small but great applications.
For getting the temperature from the CPU, use CPUTempWatch. It will display the exact temperature for each core (read directly from the internal Core 2 temperature sensor) and display it quite nicely.
To stress test your CPU, use Core2MaxPerf. Why? Because 100% load in Task manager does not necessarily mean that your CPU is really loaded. That happens because the Core 2 can optimize a lot of instructions and thus 100% in Windows is not necessarily 100% for the CPU.
If you don't believe me, just start Prime95 and use the RightMark CPU Utility to display the CPU load compared with the OS load. Only if Core2MaxPerf is active, you will see that both fields contain 100%.
Don't wonder, Core2MaxPerf is in German but easy to operate. Just download it and execute it (Note: If you see a message box on Windows Vista, try to right-click the EXE file and select "Execute with administrative privileges"). The only thing you need to configure is on which cores it should be execute.
Core2MaxPerf will then open a new window with exactly one button "Abbrechen" (Cancel) which allows you to stop Core2MaxPerf. The simple reason: If you have selected all cores even Windows will have problems accepting your commands because of the CPU load. With that single button ("Abbrechen" = Cancel) you can simply press Enter and it stops so Windows will return to normal operation.
There is currently no better CPU burn-in test than this program for sure!
Tuesday, October 17, 2006
Throwaway email addresses as a solution against spam
Most sites today require you to enter a valid email address when you want to create an account with them. For those that fear that their email address will then be used for spamming, throwaway email addresses might be a solution.
At least if you get the second email about “V|@gra” in your inbox you really wonder where the heck the spammers get your email address. A common hypothesis: At least one of the sites that require you to enter your email address has sold it.
The simple solution for this:
- Go to http://www.jetable.org/en/index (Jetable, french for “throwaway”)
- Enter your real email address
- jetable.org will generate a new email address like xcicxkj399@jetable.org
- Enter this email address as your email address on the site you wish to register
- Any email that is send to the throwaway email address is sent to your real inbox for 24 hours
- After that time the email address will simply be gone, deleted and vanished
Of course, this will render any “Forget your password? We sent it to you as email!” useless so you better have a backup of all your data present.
Sunday, February 5, 2006
Quantum Random Number Generator
Now there’s a site that generates, upon request, any number of random numbers using quantum. The cool thing about this is that the numbers it generates are absolutely unpredictable. Whenever you need some random numbers, check http://www.randomnumbers.info/index.jsp.
Okay, the transmission of the random numbers is not secure, but that’s a different story.
Friday, July 2, 2004
Reliable Synchronization – finally
I can’t remember how many times I tried out several file synchronization tools. Since I own both a normal desktop computer and a notebook it crucial to keep the files in sync or I’m suddenly stuck at the end of the world with an old file. At least one feature was missing from each of the products I checked. Either there was no preview (what will be done), no backup function (important file deleted by accident – nice) or no bidirectional synchronization (indeed, I usually change files on my notebook and want them to appear on my desktop).
Today I came across the program “ViaVersa Pro” from http://www.tgrmn.com/ which finally is the solution. Although it costs 60 bucks it offers all the features you need to keep any resource in sync. It offer a easily to understand preview what it will do, it can backup files before it deletes them and it offers bidirectional synchronization.
After several hours of testing with both a server connection (using VPN) and local desktop to notebook tests it really looks as this is finally the solution. They offer a 30 days trial version so you can test for yourself it’s worth the 60 USD. I will buy it for sure.
Sunday, February 15, 2004
Download Manager Reloaded – XI NetTransport (free)
Do you download often a lot of files from the internet? Do you wish you could control how many downloads are active at one time? Do you wish to limit the download speed so you can still surf the internet while downloading? What you need is a download manager.
XI NetTransport (XINT) from http://www.xi-soft.com/default.htm is a download manager which simply makes downloading easier. Of course, there are many other (and more well-known) download managers available but from my point of view I never came across something better than XINT.
First of all, it can monitor downloads inside Internet Explorer so each time a download starts XINT is loaded and will execute the download. The first advantage you get from this: You can limit how many jobs should be active inside XINT (Tools -> Connection -> Max. Jobs). This way, you can easily click on all download links and XINT will execute them one after another. Also, XINT can be configured to store all downloads in a specified folder, no more “Where do you want to save the file” questions IE normally triggers.
And best of all, you can specify a speed limit (Tools -> Connection -> Speed) which allows you to continue to surf the internet while downloading without being bothered by your internet connection being at 100 utilization. For example, if you have a DSL connection with one megabit downstream, your download speed is at about 90 Kbytes per second. Simply set the Speed Limit to 30 Kbytes and activate Tools -> Obey Speed Limit inside XINT. This leaves 60 Kbytes for normal surfing.
A special feature I like much is that you can configure an unlimited number of proxy servers and XINT can transfer one download using different proxy servers at once. For example, some sites limit your speed by simply checking your IP address. That way, you will never exceed their limit of, let’s say, 8 Kbytes. When you download using different proxy servers, each connection has a different IP address (since it’s the address of the proxy) and thus you have a multiple of 8 Kbytes. Okay, some webmaster are likely to kill me for this but its cool anyway.

