Home All Groups Group Topic Archive Search About
Author
21 Apr 2006 7:31 PM
rodchar
hey all,

is there a way in vb.net code to access whatever temp folder location any pc
is pointing to?

thanks,
rodchar

Author
21 Apr 2006 7:56 PM
Cerebrus
Hi,

If by the temp folder you are referring to the folder which opens when
I type %temp% in the Run field and is located at :

C:\Documents and Settings\<UserName>\Local Settings\Temp

Then you can use the GetEnvironmentVariable method of the Environment
class as  :
--------------------------
Dim path As String = Environment.GetEnvironmentVariable("Temp")
Process.Start(path)
--------------------------

If you mean the Temporary Internet Files folder, then you can simply
use the GetFolderPath method of the Environment class with the Enum
value "InternetCache".

HTH,

Regards,

Cerebrus.
Author
21 Apr 2006 10:12 PM
Herfried K. Wagner [MVP]
"rodchar" <rodc***@discussions.microsoft.com> schrieb:
> is there a way in vb.net code to access whatever temp folder location any
> pc
> is pointing to?

'System.IO.Path.GetTempPath'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
23 Apr 2006 5:00 PM
rodchar
thank you everyone.

Show quoteHide quote
"rodchar" wrote:

> hey all,
>
> is there a way in vb.net code to access whatever temp folder location any pc
> is pointing to?
>
> thanks,
> rodchar