Library code snippets
Retreive System Information with Environ
On Windows 2000/NT systems, the Environ$ function can be used to retreive certain information from the system, without using any API calls! For example, to retreive the location of the temp directory, use
Debug.Print Environ$("temp")
For the system directory, try
Environ$("windir") & IIf(Len(Environ$("OS")),
"\SYSTEM32", "\SYSTEM")
Other environment variables are also available - to see them go to Start |
Settings | Control Panel, open the System item, click the Advanced tab, and
click the Environment Variables button.
Please note: Environment variables can vary from PC to PC, are user-modifiable, and other than standard items such as WinDir and Temp, Environ should not be entirely relied apon.
Related articles
Related discussion
-
VB6, SQL 2005 & DMO
by elajaunie3 (1 replies)
-
sending sms from pc
by sriraj20074 (0 replies)
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Is TEMP environment variable available in all flavors of Windows OS?
This thread is for discussions of Retreive System Information with Environ.