I need to run a elevated x64 Native Tools Command Prompt fro VS 2019 command ("vcperf /start session") within my pipeline. I have tried different ways but I cannot make it work. This is what I tried last:
pipeline {
agent any
stages {
stage('test') {
steps {
script{
bat '"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Visual Studio 2019/Visual Studio Tools/VC/x64 Native Tools Command Prompt for VS 2019.lnk" -vcperf /start session'
}
}
}
}
}
but I get this output:
12:44:43 C:\Users\User\.jenkins\workspace\test>"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Visual Studio 2019/Visual Studio Tools/VC/x64 Native Tools Command Prompt for VS 2019.lnk" vcvarsall.bat x86_amd64
12:44:43 [ERROR:vcvarsall.bat] Invalid argument found : vcvarsall.bat
12:44:43 [ERROR:vcvarsall.bat] Error in script usage. The correct usage is:
12:44:43 Syntax:
12:44:43 vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version] [-vcvars_spectre_libs=spectre_mode]
12:44:43 where :
12:44:43 [arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
12:44:43 [platform_type]: {empty} | store | uwp
12:44:43 [winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
12:44:43 [vc_version] : {none} for latest installed VC++ compiler toolset |
12:44:43 "14.0" for VC++ 2015 Compiler Toolset |
12:44:43 "14.xx" for the latest 14.xx.yyyyy toolset installed (e.g. "14.11") |
12:44:43 "14.xx.yyyyy" for a specific full version number (e.g. "14.11.25503")
12:44:43 [spectre_mode] : {none} for libraries without spectre mitigations |
12:44:43 "spectre" for libraries with spectre mitigations
12:44:43 The store parameter sets environment variables to support Universal Windows Platform application
12:44:43 development and is an alias for 'uwp'.
12:44:43 For example:
12:44:43 vcvarsall.bat x86_amd64
12:44:43 vcvarsall.bat x86_amd64 10.0.10240.0
12:44:43 vcvarsall.bat x86_arm uwp 10.0.10240.0
12:44:43 vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
12:44:43 vcvarsall.bat x64 8.1
12:44:43 vcvarsall.bat x64 store 8.1