by Syed Natiq Abbas Kazmi (3 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 27th July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Accessing the System Environment
'environment 'variables using the ENVIRON$ function in Visual Basic.
strSystemDir = Environ$("windir")
' •-- Other environment variables can be accessed in the same fashion.
' •-- For example, the line below would retrieve the current system Path
' string:
strPath = Environ$("path")