This is the mail archive of the
cygwin
mailing list for the Cygwin project.
How to query the value of %SystemDrive% in an empty environment?
- From: Michael Haubenwallner <michael dot haubenwallner at ssi-schaefer dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 6 Aug 2019 17:20:28 +0200
- Subject: How to query the value of %SystemDrive% in an empty environment?
Hi,
using 'env -i' to create an empty environment, the SYSTEMROOT and WINDIR
environment variables are preserved (or recreated):
$ /usr/bin/env -i /usr/bin/env
SYSTEMROOT=C:\Windows
WINDIR=C:\Windows
And with cygpath, there is the -A, -D, -H, -O, -P, -S, -W and even -F flags
to query the values for various directories.
Now what I've failed to find is how to query the value for the "SystemDrive"
environment variable.
The problem behind is that I'm using "vswhere.exe" to locate some Visual Studio
environment from within some scripts run via 'env -i', causing vswhere.exe to
create a directory named "%SystemDrive%" in the current working directory:
So I better ensure the SystemDrive environment variable is set for vswhere.exe.
Any ideas?
Thanks!
/haubi/
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple