Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get system variable (like SystemRoot) 1

Status
Not open for further replies.

Trevil

Programmer
Jun 19, 2003
459
US
Hello,
We have 70+ servers that are going to be renamed this fall. Our tech folks say they will provide us with a variable named like %ServerName% that our application can use. I'm afraid I don't know how to use something like "%ServerName%" directly in code, but I do know how to read values from the system registry.

Currently we have 70+ servers around the world all named the same thing, and our app references a server path like "//server/AppFolder/".

Is there an easier way (that the tech folks won't grumble about!)?

Thank you!

Learn from the mistakes of others. You won't live long enough to make all of them yourself.
 
I don't know how to use something like "%ServerName%" directly in code
A starting point:
Environ("ServerName")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you both for your suggestion.

The 2nd link shows a list of common variables, plus code to display the names and content. Now I guess it is up to the tech folks to create and populate the variable.

Thank you again!

Learn from the mistakes of others. You won't live long enough to make all of them yourself.
 
FYI, in a console window, simply type set and press the enter key.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top