ExpEnvStrings
Top  Previous  Next


Expands environment-variable strings and replaces them with their defined values. Works both locally and on remote machines.

ExpEnvStrings (Machine, String)

Machine
Name of machine to expand variables on. Leave blank for local machine.  
 
Notice: the Remote admin service is needed in order to use the function on remote machines.  

String
String that contains environment-variable strings of the form §variableName§.  

Tip
To see all environment variables: start the command prompt and type "set".

Examples

Display %SystemRoot% variable on local machine

MessageBox
 ExpEnvStrings (,§SystemRoot§)


Display %SystemDrive% variable on machine \\edu12

MessageBox
 ExpEnvStrings (\\edu12,%SystemDrive%)

Expand %systemroot% in a Registry.Write command
Registry.Write SZ, hkey_local_machine, software\Microsoft\Windows NT\CurrentVersion\Winlogon, Test, ExpEnvStrings(%servername%,§systemroot§)\system32\myapp.exe