Friday, March 28, 2008

Start Windows Installer Service in Safe Mode

Some software messed up some Windows system files and I couldn't log on any more. Wanting to remove the software, I logged into safe mode, just to find out that Windows Installer service is not allowed to run in safe mode! Good design.

After spending some time searching, I found a solution:

To start Windows Installer in Safe Mode:
1. Restart your computer and press F8 before the Boot Menu or splash screen.
2. Open a CMD.EXE window.
3. Type the following commands and press Enter:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer" /VE /T REG_SZ /F /D "Service"
net start msiserver

NOTE: You can use this technique to uninstall an application in Safe Mode.

Friday, March 21, 2008

Print UTF-8 Characters in Eclipse Console

In eclipse, "Run Dialog", "Common" tab, change "Console Encoding" to UTF-8. The code below should print some CJK characters.


import java.io.PrintStream;
import java.io.UnsupportedEncodingException;

public class TestClass {

public static void main(String [] args) throws UnsupportedEncodingException {
String chineseString = "\u4e00\u4e01\u4e02\u4e03\u4e04";
PrintStream ps = new PrintStream(System.out, true, "UTF-8");
ps.println(chineseString);
}
}