Computing.Net > Forums > Programming > System Environment Variables in VB

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

System Environment Variables in VB

Reply to Message Icon

Name: astroraptor
Date: June 1, 2005 at 14:39:04 Pacific
OS: Windows 2000 Pro
CPU/Ram: 1.6GHz/512Mb
Comment:

Is it possible to use user/system environment variables in VB? I'm integrating a batch file into a VB program. The batch is writing to: %temp%\tmp.tmp so I'm wondering if there's a way I can open that file in VB using the system variable since %temp% is different for every user/computer. Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: June 3, 2005 at 14:08:47 Pacific
Reply:

you can use the Win32 API functions to get the special folders path or the user's path as well.

http://msdn.microsoft.com

search for Win32 API

Chi


0

Response Number 2
Name: MarkM
Date: June 22, 2005 at 12:26:12 Pacific
Reply:

A bit of an old fashioned way but simple and effective:

Environ$("[variable]")

will return the value of what ever variable you stick between the quotes.

Cheers.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: System Environment Variables in VB

setting environment variables in vb www.computing.net/answers/programming/setting-environment-variables-in-vb/13145.html

VB.NET and Environment Variables www.computing.net/answers/programming/vbnet-and-environment-variables/9708.html

Environment variable in C www.computing.net/answers/programming/environment-variable-in-c/13426.html