Replies: 2 comments 2 replies
-
Make sure |
Beta Was this translation helpful? Give feedback.
1 reply
-
The answer is I need to use the absolute path. Got hint from this answer So this should work fine.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a project using Laravel 6.20 on windows 10.
I need to run some commands from the controller, but somehow the command is always failing.
I am not sure why, here is what I have tried in the controller and the laravel tinker console:
I have tested those commands in the controller with Process component, tinker console, and windows native cmd.
cd path
php -v
schtasks
ls
.bat
fileI understand the command is by default passed to windows cmd.exe, however, I don't know why the
php -v
andschtasks
are working well in tinker and native cmd, but failed on the Process component.The error message from
getErrorOutput()
says those failed commands arenot recognized as an internal or external command, operable program, or batch file.
Does anyone have any idea on this issue? Or is that possible to use PowerShell instead of the default cmd to execute the commands? Really appreciate your help!!
Beta Was this translation helpful? Give feedback.
All reactions