OS: Windows 7 Ultimate

With fossil.exe installed in "fossil ui" and "fossil server" fail to start the web server. On each attempted access to , the command prompt outputs:

<pre>'"fossil"' is not recognized as an internal or external command,
operable program or batch file.</pre>

Windows Firewall is off and there are no other firewalls installed.

Are you able to edit your PATH variable and add another folder (e.g., where you can transfer fossil.exe instead? Fossil probably does not understand %SystemRoot%\system32, which is what's on PATH for that folder.

This is not a problem of fossil.

The mentioned error message is a MS Windows message, documenting, that the requested command is not found in the path.

So you should check:
  *  is the path really correct
  *  how do you call fossil, MS Windows doesn't use the path variables in all call variants

>Fossil probably does not understand %SystemRoot%\system32, which is what's on PATH for that folder.

I think you've hit on the problem here. It works perfectly well on XP though, which is why I'm puzzled. I will try your suggestion but ultimately will end up with Fossil back in system32, where (IMO) it belongs.

>This is not a problem of fossil.

I believe it is. Please see below for my reasons.

>The mentioned error message is a MS Windows message, documenting, that the requested command is not found in the path.<br>
><br>
>So you should check:<br>
><br>
>is the path really correct<br>
>how do you call fossil, MS Windows doesn't use the path variables in all call variants<br>

Looks like you didn't read my ticket. I'll explain again:

At the command prompt, I'm running "fossil ui". ("fossil server" does the exact same thing.) There is a known good, open fossil in the working directory. Fossil opens a web browser (Firefox in this case) and gives it the path "localhost:8080" as expected.

The problem occurs when Firefox accesses localhost:8080. Fossil is definitely listening on 8080/tcp because it reacts to connections on localhost:8080. The way it reacts is to output this error on stdout:

'"fossil"' is not recognized as an internal or external command, operable program or batch file.

instead of returning a web page to the browser.

You're right that this error is generated by the OS, but I believe the flaw is in Fossil. IMO Arnel's suggestion is correct, that Fossil is not interpreting %SystemRoot%\system32 properly. I will now attempt to prove it.


I mean, I will attempt to prove it in 8 hours or so, when I get home from work and have access to my Windows 7 box.


I can confirm "fossil server" works with fossil.exe inside the %SystemRoot%\system32 folder from a Windows 7 box I'm using.

With "fossil ui" I'm getting the "'http:' is not recognized...batch file" message. Which is odd, considering I can run "start from within the folder.

Sorry, I forgot to add: "fossil ui" does provide the error message I described earlier when I ran it from the command-line, *BUT* if I open a browser and go to it opens the web UI for Fossil.

I think the problem comes about because Fossil tries to run a copy of
itself by calling system() with argv[0] being used as the command name.
Apparently on windows, argv[0] is not a reliable name for the program
that is being run.

Does anybody have any suggestions for an alternative way to get a
windows program to run a copy of itself?

is this recently introduced?  i've been using fossil on windows 7 64 bit since it was released with no problems (not counting a few hiccups along the way in the win32 build).  i haven't updated my build for about six weeks, so i'm not experiencing this issue (Fossil version [7aae4ef068] 2010-09-03 01:57:41).

Nothing has changed in this area recently.  I think the people that are
having problems simply have an unusual windows configuration.

For my XP machine, argv[0] is correctly filled with the complete path. A windows 7 Home Premium machine shows only the filename(fossil.exe), not the complete path. Both tests used a standard cmd.exe console starting fossil with <kbd>fossil help ver</kbd> and fossils install directory in environemt variable PATH. =>
  *  on XP argv[0] seems to be filled with the complete path, so that the environment is not used
  *  on Win 7 is only the filename stored in argv[0]. This way it depends on the environment/registry settings, whether fossil is found or not.

The contents of argv[0] can be tested with

fossil help ver

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>