Wednesday, October 3, 2007

Tuesday, August 7, 2007

Running a simple Java program on Windows

let's say you have:

// Toto.java
package com.mydomain.MyTest;
public class Toto
{
public static void main (String[] args)
{
System.out.println("hello");
}
}


then, you can create a BuildRun.bat like this:

REM BuildRun.bat
javac Toto.java
copy Toto.class com\mydomain\MyTest\
java.exe com.ltu.MyJNITest.Toto

To get directly the execution shell file that you need to run, you can get it from Eclipse:
http://stackoverflow.com/questions/2502518/eclipse-export-running-configuration
.

Saturday, August 4, 2007

%ProgramFiles% environment variable

%ProgramFiles% is not like the other environment variables. It is initialized by the system with the value of ProgramFilesDir at boot time, and cannot be changed after that.

Since ProgramFilesPath value is %ProgramFiles%, it has the same value also

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion"

Usually, I just restart the console and all environment variables are set to their correct value. You can see the value of all environment variables by doing "set" in the Windows console. But %ProgramFiles" is initialized only at boot time.

Creating an environment variable %ProgramFiles% from the control panel will not modify this behaviour, even after reboot.

Tuesday, July 31, 2007

Add a new SATA hard disk

I ran into the issue that you need Windows XP SP2 to be able to install a new SATA hard disk. Well, I didn't have a Windows XP SP2 install CD, I just had a SP1. It turns out that it is pretty easy to create a SP2 from a SP1 though, here we go:

Do an XP SP2 CD from a SP1

Friday, May 25, 2007

charmap.exe

Having trouble with foreign characters on a remote machine ?: charmap.exe

Saturday, April 21, 2007

Vista UAC (User Account Control)

  • On Vista, I tried to copy a zip files from a shared folder of XP, in a regular Vista folder. A dialog box showed up and say "You need permission to perform this action".

    I tried to play around with UAC. I disabled it by doing:

    Control Panel/User Accounts

    and then "Turn User Account Control on or off". I change all the permissions of the folder. I tried to rename the file. It still didn't work. It was working with an mpeg file though.

    The only way I could eventually copy this zip file was to go on XP, and copy the zip file in a shared folder of Vista, and after that, copy it in the target Vista folder.

  • Also, sometimes, I cannot install things on Program Files because of Vista privileges nightmare, so I created a C:\MyProgramFiles where I put stuff I cannot install to other places
  •