471,350 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Using %SystemRoot% in path variables

Is there a way to use wildcards such as %SystemRoot% in a path that I pass to
a string variable for consumption in a method parameter?

Example:

string wmipath = @"%SystemRoot%\System32\WBEM\Repository"

Thanks in advance.
Jan 4 '06 #1
1 3614
One way to expand such variable is the
Environment.ExpandEnvironmentVariables method.

Hope that helps,
Thi

Jan 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Bruce A. Julseth | last post: by
7 posts views Thread by Phi | last post: by
15 posts views Thread by (Pete Cresswell) | last post: by
2 posts views Thread by Matt | last post: by
8 posts views Thread by jeffc | last post: by
4 posts views Thread by Stephen Cattaneo | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.