Rename Pictures based on Exif information

exiv2 -r'%Y-%m-%d %H%M :basename:' rename $(ls)
Renames all pictures in a directory. For example the file DSCF1200.jpg will be called 2011-12-30 1210 DSCF1200.jpg.


Mount Windows File Shares

Mounts the folder photo on from the server into the directory mount on our local machine. It uses youruser and youpassword to authenticate

sudo mount -t cifs -o username=youruser,password=yourpassword // /mount/


Installation of Certificate into Trusted Root Certification Authorities store

If you visit a webpage with a self-signed certification you will usually see the following warning: There is a problem with this website's security certificate.

To avoid the messge you need to install the certificate into the Trusted Root Certification Authorities certificat store. This can be done very easily with executing the following command:

certmgr -add Certificate.cer -s -r localMachine root

The certmgr command line tool can be found in the Windows Driver Kit Version 7.1.0


Run .NET Applications in 32-Bit Mode under 64-Bit Windows

Sometimes it is necessary to run .NET applications in 32-Bit mode. One example is the usage of Adobe Reader Interop Libraries which will crash if they run in 64-Bit mode.

cd C:\Windows\Microsoft.NET\Framework64\v2.0.50727
ldr64 setwow

This will force all .NET applications to be run in 32-Bit mode.

MSI Install Errror with CustomAction to execute a VBS-Script

The following error: "There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor"

Usually results from using the line:

	Set WShell = WScript.CreateObject("WScript.Shell")

instead of

	Set WShell = CreateObject("WScript.Shell")

this is caused because inside a MSI vbs-Scripts are executed with a different object model than when running standalone.



Show PDF-Documents in a C# WPF Application

The easiest way to do this is to display the Adobe Reader Browser Plugin. This can be done with a UserControl which can be hosted in a WindowsFormsHost control in a WPF Form. You require a reference to the dlls AxInterop.AcroPDFLib.dll and Interop.AcroPDFLib.dll which you can find in the Reader SDK on the Adobe Developer Homepage. The code for a UserControl is shown below:


C# Automating Exel - Document not saved error

If you try to automate Microsoft Excel in the background with a C# Application (Microsoft.Office.Interop.Excel) after processing some documents sometimes an error "Document not saved" pops up. If you do not wish to save the document you can supress the message like this:

var excelApp = new Microsoft.Office.Interop.Excel.Application(); 
excelApp.DisplayAlerts = false;


C# Convert Excel, Word- and PowerPoint-Documents to XPS

You can easily automate the office apps to convert office documents to the XPS-Format. With Microsoft Word you can as well convert RTF, HTML and TXT Documents to the XPS Format.

You need to reference the following Assemblies:

- Microsoft.Office.Interop.Excel

- Microsoft.Office.Interop.PowerPoint

- Microsoft.Office.Interop.Word

- Office


Access MS Exchange with Java

MySQL Server 5.5 Logging on Windows 7

First you need to find out which settings file is active. Usually you can find it under C:\ProgramData\MySQL\MySQL Server 5.5\my.ini. Then you need to add the output configuration. Be careful to use the right syntax for the path. Below [mysqld] you can add something like:

general_log = 1 
general_log_file = "C:/mysql-queries.log"

After you restart the service your queries will be logged. If it doesn't work you can consult the Errorfile (C:\ProgramData\MySQL\MySQL Server 5.5\data\computername.err)




Subscribe to RSS