For my XP machine, argv[0] is correctly filled with the complete path. I'll test it later on my Win7HP machine.

The contents of argv[0] can be tested with

fossil help add

The name of the binary, displayed in the output is replaced with argv[0].

Windows uses diffent ways to find a binary (calling via cmd.exe or calling by explorer,..). So if argv[0] doesn't contain a full path, the error  may appear.

I've found a link to some information, how to get the application location:


<pre>
DWORD WINAPI GetModuleFileName(
  __in_opt  HMODULE hModule,
  __out     LPTSTR lpFilename,
  __in      DWORD nSize
);
</pre>