timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-27728] Windows Batch execution will not work with quoted arguments that have spaces #7103

Open timja opened 9 years ago

timja commented 9 years ago

I have a batch script that I am passing two full path with filenames arguments to and one of those paths has spaces in it. I have tried double quotes and many other options with the same results of the argument being broken on the spaces by Jenkins.


Originally reported by jstarbird, imported from: Windows Batch execution will not work with quoted arguments that have spaces
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 9 years ago

danielbeck:

Please provide some information how this can be reproduced.

Please confirm that the issue is specific to Jenkins. In general, batch build steps are saved as file and executed as argument to cmd.exe, so it's unlikely this is a Jenkins issue.

timja commented 9 years ago

jstarbird:

Daniel,
I can run the exact same batch file passing it the same parameters from a CMD window on the same build system and it works with double quotes.
In Jenkins when I put in D:\scripts\batch.bat d:\somepath to a file\file.blh d:\someother path\foo.bar and put double quotes around each param, so D:\scripts\batch.bat "d:\somepath to a file\file.blh" "d:\someother path\foo.bar"
it will fail. I even tried double quotes around the script itself. Do the same thing in CMD window on the same system, it works.

You mentioned Jenkins saves the batch files to a temp file, I did know that but they get deleted to quickly for me to see them. Is there a way to turn off the delete part?

Thanks.

timja commented 9 years ago

jstarbird:

Incorrectly thought I had a work around but I haven't found one yet.