Closed selvakumar7991 closed 4 years ago
The reason is that the script (script.bat
) exits with code 1.
You can try use -show-errors
option for show this error in browser.
My browser showing empty response after adding -show-errors option for show this error in browser like below
shell2http -form -show-errors /starttest "C:\Selva\software\shell2http\script.bat" 2020/03/02 15:32:07 register: /starttest (C:\Selva\software\shell2http\script.bat) 2020/03/02 15:32:07 register: / (index page) 2020/03/02 15:32:07 listen http://:8080/ 2020/03/02 15:32:09 localhost:8080 [::1]:57083 GET /starttest "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36" 2020/03/02 15:32:09 exec error: exit status 1
sorry, it turned out that this option is about another. Anyway, you should investigate your script, why it exits with code 1
okay thanks man
I tired with basic command in the bat file, Still getting above error only, Do you any idea about this
shell2http -form /starttest "C:\Selva\software\shell2http\sam.bat" 2020/03/02 15:56:06 register: /starttest (C:\Selva\software\shell2http\sam.bat) 2020/03/02 15:56:06 register: / (index page) 2020/03/02 15:56:06 listen http://:8080/ 2020/03/02 15:56:09 localhost:8080 [::1]:58464 GET /starttest "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0" 2020/03/02 15:56:09 exec error: exit status 1 2020/03/02 15:56:11 localhost:8080 [::1]:58464 GET /starttest "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0" 2020/03/02 15:56:11 exec error: exit status 1
I don’t have Windows right now, but please try that script:
ipconfig
if errorlevel 1 (
echo Failure reason given is %errorlevel%
exit /b 0
)
and run command like this:
shell2http -include-stderr /starttest "c:\path\to\script\sam.bat"
still getting same issue. let me try this same in linux machine
You should use real path to script, not "c:\path\to\script\sam.bat"
(this is example)
And please just run this script from terminal, is it running normally?
ran this script from terminal, it is running fine
folder structure for your reference
i see - test.bat is nothing output
you can use ipconfig directly:
shell2http -include-stderr /starttest ipconfig
tired to use directly, but getting different error
shell2http.exe -include-stderr -port=8010 /test "C:\Selva\NeoLoad 7.2\bin\NeoLoadCmd.exe" 2020/03/03 12:27:41 register: /test (C:\Selva\NeoLoad 7.2\bin\NeoLoadCmd.exe) 2020/03/03 12:27:41 register: / (index page) 2020/03/03 12:27:41 listen http://:8010/ 2020/03/03 12:27:49 localhost:8010 [::1]:58124 GET /test "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36" 2020/03/03 12:27:59 exec error: exit status 3221226505
script (or any program) must be return 0
exit code, in any other case there will be such an error
Planning to build an own API according to my recruitment, Anyway, Thanks for your help
C:\Selva\software\shell2http>shell2http -form /starttest "C:\Selva\software\shell2http\script.bat" 2020/03/02 14:17:56 register: /starttest (C:\Selva\software\shell2http\script.bat) 2020/03/02 14:17:56 register: / (index page) 2020/03/02 14:17:56 listen http://:8080/ 2020/03/02 14:18:05 localhost:8080 [::1]:55677 GET /starttest "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36" 2020/03/02 14:18:05 exec error: exit status 1
Getting above error when we tired an api for executing a bat file http://localhost:8080/starttest