Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Help and How-to
Search
Search
 
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Using Environment Variables in System Policies
 
Managing Users’ Options with System Policies

Windows 95/98, Windows NT 4.0, and Windows 2000 all include the capability to use environment variables in the Windows registry to take the place of actual file names, paths, or other changeable values. Environment variables in the Windows registry take the REG_EXPAND_SZ data type.

Although Windows system policies have used environment variables for some time, Office 97 did not recognize the data type REG_EXPAND_SZ, so you could not use environment variables in Office 97 system policies. However, you can use environment variables in Office 2000.

For example, the Default file location policy for Excel 2000 allows you to specify a default path to the location where you want users to store Excel files. If you want to store users’ Excel files under their user names on the network, you can use a network drive and the following environment variable:

X:\%USERNAME%

When you distribute the policy, the environment variable is written to each user’s registry. Office 2000 recognizes that %USERNAME% is an environment variable and expands it to whatever the %USERNAME% variable is set to on the user’s computer. So Office 2000 expands this example to X:\UserA for User A, X:\UserB for User B, and so on.

You could also use any other appropriately defined environment variable to set Default file location to a particular path or folder. Because Office 2000 recognizes the REG_EXPAND_SZ data type, you can use environment variables that exist by default in the operating system or that you set on your own.


 Note    Windows 95/98 does not create environment variables automatically. You must create and define variables manually so that they resolve correctly for each user. For example, to create the %USERNAME% environment variable for Windows 95/98 clients, use a Windows NT logon script.


See also

Several Office 2000 system policies accept environment variables. For a list of these policies, see Office 2000 System Policies That Accept Environment Variables.

You can use environment variables in place of directory paths or specific user information. For more information, see the Windows NT Server Resource Kit or the Windows NT Workstation Resource Kit.

advertisement