|
Environment variables |
Top |
|
Environment variables Environment variables contain some system information that can be used in our work. For instance, you can create just one preset that will backup different files to different folders depending on which user is currently logged in to Windows. You can see the whole set of environment variables available for you by typing "set" in the command prompt. Generic useful variables for Windows 98/ME are as follows (the names are standard but the values are different in most computers): TEMP=C:\WINDOWS\TEMP TMP=C:\WINDOWS\TEMP winbootdir=C:\WINDOWS windir=C:\WINDOWS And here is the list for Windows 2003 Server: ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\YOU\Application Data CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=YOURCOMPUTER HOMEDRIVE=C: HOMEPATH=\Documents and Settings\YOU LOGONSERVER=\\YOURCOMPUTER ProgramFiles=C:\Program Files SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\DOCUME~1\YOU\LOCALS~1\Temp TMP=C:\DOCUME~1\YOU\LOCALS~1\Temp USERDOMAIN=YOURCOMPUTER USERNAME=YOU USERPROFILE=C:\Documents and Settings\YOU winbootdir=C:\WINDOWS windir=C:\WINDOWS In the given list "YOU" will be automatically replaced with the current user name and "YOURCOMPUTER" with the computer name. You can also specify your own variables by typing "set varname=varvalue", for instance "set mybackuppath=c:\backups". How can we use these variables? Example: We create a single preset for all users in the network. To use a variable, we wrap it to "%"s: Copy to folder path (actions tab): "\\MyServer\Backups\%COMPUTERNAME%" Archive name (general tab): "Docs_%USERNAME%" Variations of use: 1) User "Joe" logged in to computer "Hudson", OCB stores the backup file to \\MyServer\Backups\Hudson\Docs_Joe.rar. 2) User "Mike" logged in to computer "Hudson", OCB stores the backup file to \\MyServer\Backups\Hudson\Docs_Mike.rar. 3) User "Bill" logged in to computer "Smith", OCB stores the backup file to \\MyServer\Backups\Smith\Docs_Bill.rar. 4) ... So just one preset can be used to create a universal backup store for multiple users on multiple computers. Very soon OCB will be able to understand variables in file lists.
SEE ALSO: Preset configuration - General tab. Preset configuration - Actions tab. Preset configuration - File lists tab.
|