Windows environment variables

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Select Topics in Script Programming >

Windows environment variables

 

Windows environment variables can be used in two ways. One way is to pass the environment variable as an argument into Robo-FTP from a shortcut or the Windows Command Prompt command line. Consider the following example where the environment variable %SystemDrive% is passed in as an argument.

 

C:\Program Files\Robo-FTP X.X\Robo-FTP.exe –p1 %SystemDrive%

 

The SET command may also be used to copy the value of an environment variable into a Robo-FTP script variable.  Consider the following example where the operating system environment variable %SystemDrive% is set to the Robo-FTP script variable named sysdrive:

 

SET sysdrive = %SystemDrive%

 

Here is a list of common Windows environment variables:

%ALLUSERSPROFILE%

Path to the All Users profile directory which contains resources and settings that are shared by all accounts. This is renamed %PROGRAMDATA% starting with Windows Vista.

%APPDATA%

Path to the Application Data folder of the logged-in user. This folder is hidden by default on some systems.

%COMPUTERNAME%

Computer name.

%HOMEDRIVE%

Defaults to C:

%HOMEPATH%

Defaults to \Documents and Settings\<user name>

%LOGONSERVER%

Name of the computer that authenticated the current user's credentials.

%PATH%

The operating uses this list of folders to search for executable programs. If you add the Robo-FTP installation folder to your system's PATH environment variable you can create Scheduled Tasks that simply call the Robo-FTP.exe executable without the full installed file path.  

%PROGRAMFILES%

Path to the \Program Files folder, the %PROGRAMFILES(X86)% and %PROGRAMW6432% environment variables are available on 64-bit machines.

%SystemDrive%

Defaults to C:

%TEMP%

Path to folder where temporary files should be stored. Same as %TMP%

%USERDOMAIN%

Domain name.

%USERNAME%

User name.

%USERPROFILE%

Default to %SystemDrive%\Users\<user name> on newer versions of Windows, on older versions the default was %SystemDrive%\Documents and Settings\<user name>

%WinDir%

Defaults to C:\Windows

 

Environment variables may contain different values for each Windows user account. Use system-wide environment variables machines where Robo-FTP may be launched by a built-in account like Network Service or Local System. Even if Robo-FTP will only ever be launched by regular user accounts it is probably best to use system-wide environment variables unless you specifically need the ability for users to  have unique values.

 

environment_variables

 

 

 

Related command(s): SET

See also: -p Command Line Switch, Using the %installdir variable, Adding Robo-FTP to the Path