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 6545997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:39:18+00:00 2026-05-25T11:39:18+00:00

I am trying all kinds of variants of the following command: powershell -command ‘C:\Program

  • 0

I am trying all kinds of variants of the following command:

powershell -command "'C:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat' x86" -noexit

I am hoping to run Powershell with the VS environment vars – to no avail. I just cannot get the quotes right.

  • 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-25T11:39:18+00:00Added an answer on May 25, 2026 at 11:39 am

    Have a look at the PowerShell Community Extensions. It comes with a command to invoke a batch file, “remember” what env vars it set and bring those into your PowerShell session. In fact, my profile does just this with the VS vars e.g.:

    Import-Module Pscx
    
    function Import-VS9Vars
    {
        $vcargs = ?: {$Pscx:Is64BitProcess} {'amd64'} {'x86'}
        Push-EnvironmentBlock -Description "Before importing VS 2008 $vcargs var"
        Invoke-BatchFile "${env:VS90COMNTOOLS}..\..\VC\vcvarsall.bat" $vcargs
    }
    
    function Import-VS10Vars
    {
        $vcargs = ?: {$Pscx:Is64BitProcess} {'amd64'} {'x86'}
        Push-EnvironmentBlock -Description "Before importing VS 2010 $vcargs vars"
        Invoke-BatchFile "${env:VS100COMNTOOLS}..\..\VC\vcvarsall.bat" $vcargs
    }
    
    Import-VS10Vars
    

    The important command is the Invoke-BatchFile. The source to this function comes in the download so if you don’t want to use the whole module, you can copy out just that one function if you’d like.

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

Sidebar

Related Questions

I've got myself in a right mess following all kinds of semi-relevant tutorials trying
So, I've been trying to get redmine to work with following all kinds of
I am trying to get the users preferred language. I see all kinds of
I'm getting confused and frustrated after a few hours of trying all kinds of
I've been having problems and, after spending a week trying out all kinds of
I'm having all kinds of grief trying to re-use a jQuery-UI dialog. First time
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
I was trying all of yesterday to try and integrate a SQL Database with
I may be way off base, but I've been trying all afternoon to run
Trying to keep all the presentation stuff in the xhtml on this project and

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.