小编Mat*_*ker的帖子

可能的 Windows 8 cmd 更改?

出于某种原因,我决定在我的开发机器上试用 Windows 8。到目前为止,一切都很好,直到我尝试启动具有一些自定义功能的 Powershell,包括PATHvcvars32.bat.

最初,脚本是从这里提取的/sf/ask/9670111/进行了一些更改以允许它在 x64 Powershell 实例中运行,所以它最终看起来像这样:

function Get-Batchfile($file) 
{
    $theCmd = "`"$file`" & set" 
    cmd /c $theCmd | Foreach-Object {
        $thePath, $theValue = $_.split('=')
        Set-Item -path env:$thePath -value $theValue
    }
}

function VsVars32($version = "10.0")
{
    $theKey = "HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\" + $version
    $theVsKey = get-ItemProperty $theKey
    $theVsInstallPath = [System.IO.Path]::GetDirectoryName($theVsKey.InstallDir)
    $theVsToolsDir = [System.IO.Path]::GetDirectoryName($theVsInstallPath)
    $theVsToolsDir = [System.IO.Path]::Combine($theVsToolsDir, "Tools")
    $theBatchFile = [System.IO.Path]::Combine($theVsToolsDir, "vsvars32.bat")
    write-host $theBatchFile
    Get-Batchfile $theBatchFile
    [System.Console]::Title = "Visual Studio " + $version + " …
Run Code Online (Sandbox Code Playgroud)

powershell command-line windows-8

5
推荐指数
1
解决办法
4491
查看次数

标签 统计

command-line ×1

powershell ×1

windows-8 ×1