Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Passed parameters executes differently than hardcoded parameters #36

Closed
NickE37 opened this issue Jan 10, 2018 · 6 comments
Closed
Assignees

Comments

@NickE37
Copy link

NickE37 commented Jan 10, 2018

Awesome program, but I am having a problem in Windows. I am trying to have shell2http run a console executable that requires parameters and uses libraries (dll) in the same directory as the executable.
If I use the below to start shell2http:
shell2http -form /Test "C:\Test\Test.exe Arg1 Arg2 Arg3"
and
http://localhost:8080/Test
It works fine.

But

If I use the below to start shell2http:
shell2http -form /Test "C:\Test\Text.exe %v_arg1% %v_arg2% %v_arg3%"
and
http://localhost:8080/Test/Text.exe?arg1=Arg1&arg2=Arg2&arg3=Arg3

then I get an error that the library dlls cannot be found (even though C:\Test is in the PATH environment variable.

Am I doing something wrong?

Thank you for your help!

@msoap
Copy link
Owner

msoap commented Jan 10, 2018

Current working directory for server - is there where the shell2http started.
Please try:
shell2http -form /Test "cd C:\Test\ && Text.exe %v_arg1% %v_arg2% %v_arg3%"

or try url: http://localhost:8080/Test?arg1=Arg1&arg2=Arg2&arg3=Arg3, /Text.exe - is not necessary.

@NickE37
Copy link
Author

NickE37 commented Jan 10, 2018

This problem persists even if I move the shell2http.exe to the C:\Test directory.

If I use the below to start shell2http:
shell2http -form /Test "C:\Test\Test.exe Arg1 Arg2 Arg3"
and
http://localhost:8080/Test
It works fine.

But

If I use the below to start shell2http:
shell2http -form /Test "C:\Test\Text.exe %v_arg1% %v_arg2% %v_arg3%"
and
http://localhost:8080/Test?arg1=Arg1&arg2=Arg2&arg3=Arg3

It still fails to find a needed dll that is in that C:\Test directory.

Any thoughts?

@msoap
Copy link
Owner

msoap commented Jan 10, 2018

Variant: shell2http -form /Test "cd C:\Test\ && Text.exe %v_arg1% %v_arg2% %v_arg3%" also fails?

@NickE37
Copy link
Author

NickE37 commented Jan 10, 2018

Yes, that failed in exactly the same way.

@msoap
Copy link
Owner

msoap commented Jan 11, 2018

I install a virtual machine with Windows and reproduced bug. The PATH environment variable is not passed to the script if exists -form option.

For temporary workaround use -export-all-vars option:
shell2http -export-all-vars -form /Test "C:\Test\Text.exe %v_arg1% %v_arg2% %v_arg3%"

@msoap
Copy link
Owner

msoap commented Jan 21, 2018

@NickE37 please use the latest version. It should fix the problem. Reopen if the problem recurs.

@msoap msoap closed this as completed Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants