Skip to content

Instantly share code, notes, and snippets.

@vilbeyli
Created February 24, 2018 19:19
Show Gist options
  • Select an option

  • Save vilbeyli/6b0f5bd319392db52d45d3eb0ef01583 to your computer and use it in GitHub Desktop.

Select an option

Save vilbeyli/6b0f5bd319392db52d45d3eb0ef01583 to your computer and use it in GitHub Desktop.
import winreg
import os
VS_REG_PATH = r"SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7"
def GetVS2017Path():
vs_registry_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, VS_REG_PATH, 0, winreg.KEY_READ)
value, regtype = winreg.QueryValueEx(vs_registry_key, "15.0")
winreg.CloseKey(vs_registry_key)
return value
print GetVS2017Path()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment