Tip

Use environment variables in multiple contexts

Most administrators should be familiar with environment variables, which let you refer to areas such as the system directory without having to hard-code it. For instance, the environment variable %SystemRoot% refers to whatever the current system directory is -- usually C:\Windows, but by using the environment variable you can refer to it no matter where it actually resides. Unfortunately, environment variables are limited in their flexibility, only refer to a small range of system objects, and they can't be used in many contexts.

    Requires Free Membership to View

EnvRep 2.2, from Outside the Box, is a freeware utility designed to help overcome some of the limitations of environment variables. When supplied with a source file, EnvRep 2.2 replaces specially designated variables in the source file with real-time data that can then be piped to a new file. The resulting file can be run as a batch file or used in a log operation or as part of a report. Or, you can put it to a number of other uses.

Many of the variables supported by EnvRep are exclusive to the program and aren't supported as environment variables in Windows by default. For instance, the variable #APPDATA# is replaced with the path to the currently logged-in user's Application Data folder. #CLIPBOARD# is replaced by any text data currently on the clipboard and #DESKTOP# returns the path to the current user's Desktop. Input files can be ASCII or UTF-8, but clipboard text data in non-ASCII format is generally not recognized.

Along with the program, you get the full list of some forty or more custom environment variables. Running envrep /l from the command line gives you a list all the variables available. Existing system environment variables can also be used, whether defined by the system or by the user beforehand.

 


Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators -- and please share your thoughts as well!


More information from SearchWinSystems.com


This was first published in October 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.