My declarative script contains:
environment {
VSMSBUILDCMD_14_0 = 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsMSBuildCmd.bat'
VSMSBUILDCMD_14_1 = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsMSBuildCmd.bat'
}
<snip>
steps {
bat '''
call "%VSMSBUILDCMD_14_1%"
msbuild <snip>
'''
This results in error:
c:\jenkins\workspace\MyJob>call "%C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat%"
\Java\jre1.8.0_161\bin"" was unexpected at this time.
I think I need to escape ‘Program Files (x86)’. What is the correct syntax for this please?
Best regards
David
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1780c53558db4c81b98ca30e74c2d40a%40EUX13SRV2.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.
> I'd guess you need to escape the spaces in the original string?
Escaping didn’t help.
I’ve posted a complete description of the problem on Stackoverflow:
From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com]
On Behalf Of Andrew Bayer
Sent: 18 April 2018 15:27
To: jenkins...@googlegroups.com
Subject: Re: Declarative script: How to escape 'Program Files (x86)'?
I'd guess you need to escape the spaces in the original string? I dunno - I don't have a Windows environment handy to test on.
A.
On Wed, Apr 18, 2018 at 6:28 AM, David Aldrich <David....@emea.nec.com> wrote:
My declarative script contains:
environment {
VSMSBUILDCMD_14_0 = 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsMSBuildCmd.bat'
VSMSBUILDCMD_14_1 = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\Tools\\VsMSBuildCmd.bat'
}
<snip>
steps {
bat '''
call "%VSMSBUILDCMD_14_1%"
msbuild <snip>
'''
This results in error:
c:\jenkins\workspace\MyJob>call "%C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsMSBuildCmd.bat%"
\Java\jre1.8.0_161\bin"" was unexpected at this time.
I think I need to escape ‘Program Files (x86)’. What is the correct syntax for this please?
Best regards
David
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1780c53558db4c81b98ca30e74c2d40a%40EUX13SRV2.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdOY_r3oGaNMaa9SRYFsSg4QNSPOfWyvA66LLXsQXGZUogA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Click here to report this email as spam.