954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Get current user profile folder

Hi!

I've been searching for a while, but it seems that I can't find an easy way to get the current user profile folder. I've tried "%userprofile%" environment variable, but it didn't worked (or I'm doing something wrong).

How can I do it? I want to add the value to an string variable.

I actually tried something like:

Dim Userfolder As String = %UserProfile%


I tried with quote marks too, but none seems to do the trick.
What I'm missing?

Thanks!

RenanLazarotto
Posting Whiz in Training
247 posts since Nov 2010
Reputation Points: 16
Solved Threads: 10
 
Dim s As String = Environment.GetEnvironmentVariable("UserProfile")
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Yay! It worked. Now I just need to finish up with my logic, and build the interface itself.

Thanks, an REALLY easy solution. (:

RenanLazarotto
Posting Whiz in Training
247 posts since Nov 2010
Reputation Points: 16
Solved Threads: 10
 

You're welcome.

Please mark this thread as solved if you have found an answer to your question and good luck!

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You