API call to shell32.dll via FindExecutableA returns "Can not find the specific path" on UNC paths

587 views Asked by At

I am doing an API call to FindExecutableA (Ansi version of FindExecutable) via shell32.dll from Smalltalk, but when I send UNC paths like

\\\serverName\\sharedFolder\filename

it returns error code 2, which basically means that the system could not find the given path.

The strange thing is that when I use paths like

\\\myPcName\C$\sharedFolder\filename

where C$ is the shared name of C:\ in my Pc, then it works.

I would like to make it work for "normal" UNC paths like the first one I wrote above. The system I am using is Windows XP SP3 and the shell32.dll has version number 6.0.2900.6072

I've been searching the net without luck. Has anyone got any tips?

Thanks!

1

There are 1 answers

0
Henrik Høyer On

According to http://msdn.microsoft.com/en-us/library/windows/desktop/bb776419(v=vs.85).aspx the error code 2returned from FindExecutable is: "The specified file was not found"

This means your UNC paths are invalid, use \\servername\sharename\dirname\filename