Friday, January 30, 2009

IF EXIST for directories

Sometimes you simply need to use batch files, although they are something from the past. In a current project, a custom made service wanted to copy a given file using a batch file. This didn't worked on all machines, because the customer has started to roll out MUI installations where the userprofile folder differs:

Default Windows XP (German) profile folder: C:\Dokumente und Einstellungen\
Default Windows XP (MUI) profile folder: C:\Document and Settings\

The solution (seems) rather simple:

IF EXIST "%SYSTEMDRIVE%\Dokumente und Einstellungen" GOTO DEUTSCH

Well, this doesn't work because IF EXIST can only check for files, but not for folders. The trick is to append "\." at the end because every folder contains this "virtual file". Therefore, the batch would look like this:

IF EXIST "%SYSTEMDRIVE%\Dokumente und Einstellungen\." GOTO DEUTSCH

GOTO ENGLISH





:DEUTSCH

echo German XP

goto ende



:ENGLISH

echo English or MUI XP

goto ende



:ende

pause

Wednesday, January 21, 2009

DHCP Error: Service provider could not loaded or initialized

I just had to fix a Windows XP machine that displayed the following error message in event log:

Event Type: Warning
Event Source: Dhcp
Event Category: None
Event ID: 1006
Description:
Your computer was unable to automatically configure the IP parameters for the Network Card with the network address XXXXXXX. The following error occurred during configuration: The requested service provider could not be loaded or initialized.

The computer did not receive any DHCP address and instead always used a automatically assigned one (169.x.x.x). Trying ipconfig /renew also resulted in the exact same message:

An error occurred while renewing interface Local Area Connection. The requested service provider could not loaded or initialized.

This has happened after the removal of an UMTS (3G) Network card. The solution is rather simple: Just enter

netsh winsock reset catalog (More information)

inside a command prompt After that command, the computer was back to normal.

Monday, January 12, 2009

Amazon A9 gone mad

Normally Amazon finds what I'm looking for. But searching for a "Fritz! Box", a router with WLAN, VoIP options etc. in Black (schwarz in German) resulted in these three results.

The first result one is okay, result two is not really what I was searching for but the last result is really insane: Swimmies!

Tuesday, January 6, 2009

Please replace the non-existent hard drive

I just love HP ProLiant Servers. I think I have set up nearly 100 of those in my carrier, and exactly one really failed every (main board broken). You get great support and even new drivers for servers that are out of production for three years.

However, the following message I received yesterday was just so funny:



BTW: Yes I know the message comes from the fact that the drive I added had still some array information on it. But it's funny anyway.