Environment variables in QTP are of three types:
1) Built-in (Read only)
2) User-defined Internal (Read only)
3) User-defined External (Read/Write)
You Set the Environment Variable using the following syntax
Environment.Value( "name") = "Guru99"
You can Retrieve the Environment Variable using following syntax
Environment.Value("name") -- This will retrun name as Guru99
Environment.Value("OS") -- This will return your system OS