public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How to query the value of %SystemDrive% in an empty environment?
@ 2019-08-06 15:20 Michael Haubenwallner
  2019-08-06 15:41 ` Corinna Vinschen
  2019-08-07  2:33 ` Brian Inglis
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Haubenwallner @ 2019-08-06 15:20 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-08-07 14:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 15:20 How to query the value of %SystemDrive% in an empty environment? Michael Haubenwallner
2019-08-06 15:41 ` Corinna Vinschen
2019-08-06 15:47   ` Bill Stewart
2019-08-06 15:53     ` Corinna Vinschen
2019-08-06 16:10       ` Bill Stewart
2019-08-06 16:25         ` Corinna Vinschen
2019-08-06 17:08           ` Bill Stewart
2019-08-07  2:33 ` Brian Inglis
2019-08-07 11:09   ` Michael Haubenwallner
2019-08-07 11:19     ` Corinna Vinschen
2019-08-07 12:41       ` Michael Haubenwallner
2019-08-07 14:31         ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).