Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 843651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:09:44+00:00 2026-05-15T06:09:44+00:00

I have a large project made of many C++ and C# projects, and a

  • 0

I have a large project made of many C++ and C# projects, and a MSBuild (3.5) script to build the whole thing. This script is based on the VCBuild (C++ projects) and MSBuild (C# projects) tasks. It is regularly executed by a Continuous Integration server.

I want to be able to select a specific Windows SDK (v6.0A, v7.0, v7.1…) to be used for compilation. As I have many branches in my repository that would ultimately need a different SDK version, I need a way to select the right one before each compilation.

On my computer, I have been able to setup a batch script that calls the right SetEnv.cmd before launching the MSBuild script. But this solution is not usable on the CI server as the MSBuild script is executed directly.

Do you know of a way to achieve the equivalent of SetEnv.cmd under MSBuild?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:09:45+00:00Added an answer on May 15, 2026 at 6:09 am

    I ended up creating a custom MSBuild task that would take a batch file name as parameter, execute the following command line (having batch.cmd as a parameter) :

    cmd.exe /E:ON /V:ON /S /C "batch.cmd > nul && SET"
    

    The output is then parsed, and I set the environment variables accordingly for the current process.

    This way, I can execute SetEnv.cmd and get the right environment variables in the MSBuild process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather large project made up of lots of...projects, each with their
I have a large .sln file with many projects. I just made a change
I have a large complex PHP project made up of many PHP files. Is
I have a large project where we have 2-3 dll projects that are converted
I am on a large project, and have not really made any comment 'headers'
I have made a list based navigation bar for my newest project and I
For a large project I have the following setup: a content editor made with
I have a large project that executes without problem when not debugging (even when
I have a large project but I need only some folders in my svn
I have a large project in Vb.net which drives a web browser control around.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.