Sublime Forum

How do I use environment variables in project files?

#1

Hi, I’m trying to create a project specific build system which references Visual Studio’s devenv.exe… which is generally located via an environment variable VC90COMNTOOLS.

So this is what I have, which obviously doesn’t work. But how do I make that environment variable work?

	"build_systems":
	
		{
			"cmd":
			
				"%VS90COMNTOOLS%\\..\\IDE\\devenv.exe",
				"/Build",
				"\"Win32Debug|x64\"",
				"project.sln"
			],
			"name": "Debug x64"
		}
	]
0 Likes

#2

You might have some luck putting a "shell"=true key/val at the same level as cmd

That way it will run the command via cmd.exe which I’m guessing might expands the env vars?

0 Likes