Running into some issues using the exec task. I want to run an exe, so I set up the working directory and specified the exe on the command line. It throws an exception saying it can’t find the file in the directory it’s sitting in!
Cause: Cannot run program “xxx.exe” (in directory “C:\sandbox\project1”): CreateProcess error=2, The system cannot find the file
specified Cause: CreateProcess error=2, The system cannot find the file specified
However, it does find it if I use ‘cmd’, ‘/c’, ‘xxx.exe’ as the command line.
I have tried the executable option too, with same issue.
Any ideas why this is the case? Where can I find further details/examples on using the exec task (I looked at the user guide)?
It’s the expected behavior. You have to add ‘cmd’ and ‘/c’ on Windows. Maybe Gradle could do this automatically. I’m not sure of the implications though.
The best source of information for DSL/API question is the DSL reference.
Ya i’ve been having issues with this for months… i haven’t found a solid solution yet. If anyone knows how to deal with this correctly that would be appreciated!