public static void main(String[] args) {
ISWbemServices wbemServices = null;
try {
/* Connecting to WMI repository on current machine */
System.out.print("=> Connecting to WMI repository on current machine...");
ISWbemLocator wbemLocator = ClassFactory.createSWbemLocator();
// Connect to current machine
wbemServices = wbemLocator.connectServer("localhost", "Root\\CIMv2", "", "", "", "", 0, null);
// Connect to remote machine
// wbemServices = wbemLocator.connectServer("192.168.0.3",
// "Root\\CIMv2", "Dominique", "Dominique", "", "", 0, null);
System.out.println("Connected !");