Page 1 of 1
runret - flags = 2
Posted: 20 Aug 2017 13:02
by highend
2: Return the exit code of the process. Useful mainly for debugging.
Of the process I've used for the command param?
In that case it seems it doesn't work as it should...
If I open a cmd prompt and execute a tiny program called "Get current keyboard layout.exe"
(which doesn't print anything out by itself)
and afterwards
echo %errorlevel%
I get the returncode of that .exe, e.g.
407
or
409
These are the last 3 characters of the output of the Win32 API function GetKeyboardLayout
in this case, either with an english or with a german keyboard layout active
But trying the same from withing XY scripting, the return value is empty...
Code: Select all
$kbl = runret("R:\Get current keyboard layout.exe", <curpath>, 2);
Re: runret - flags = 2
Posted: 20 Aug 2017 15:25
by admin
The returncode is the exit code of the process "R:\Get current keyboard layout.exe".
The API is GetExitCodeProcess().
Re: runret - flags = 2
Posted: 20 Aug 2017 15:49
by highend
Ok, but as I said, it does not seem to work...
To try something like that yourself:
https://bintray.com/artifact/download/v ... 2-mingw.7z
Exit codes from curl:
https://ec.haxx.se/usingcurl-returns.html
Execute curl.exe from the bin folder from a command prompt with:
Code: Select all
curl.exe http://www.ab111343234.de
Output:
Code: Select all
curl: (6) Could not resolve host: www.ab111343234.de
6
And now do it from XYplorer:
Code: Select all
text "'" . runret("""<path to curl>\curl.exe"" http://www.ab111343234.de --silent""", , 2) . "'";
The result is an empty string and not 6...
Re: runret - flags = 2
Posted: 20 Aug 2017 16:08
by admin
You forgot one comma before the flags parameter.

This works:
Code: Select all
text "'" . runret("""<path to curl>\curl.exe"" http://www.ab111343234.de --silent""", , , 2) . "'";
Re: runret - flags = 2
Posted: 20 Aug 2017 16:15
by highend
Args...
