[fpc-pascal] If ShellExecute(0, 'open', PChar(ExecuteName), '', '', 0) <= 32 Then
Henry Vermaak
henry.vermaak at gmail.com
Wed Jan 28 10:56:06 CET 2009
2009/1/28 vmars <vmars at rgv.rr.com>:
> I tried many combinations of "%COMSPEC% /c Del2Pas.bat"
> ExecuteName := ('C:\\WINDOWS\\system32\\cmd.exe ' + AppPathExe +
> 'Del2Pas.bat');
> ExecuteName := ('"%COMSPEC%/c Del2Pas.bat"');
> and many more!
> but still:
>
> Unable to open file: "%COMSPEC%/c Del2Pas.bat" ErrorCode=0
the shell is responsible for resolving environment variables, so you
need to retrieve comspec yourself with "GetEnvironmentVariable" in
sysutils.
henry
More information about the fpc-pascal
mailing list