Simon
Simon

Reputation: 9425

.NET get a local temp directory accessible by all users

As the title states, how can i get a temp directory acessible by all users.

Path.GetTempPath() returns the temp directory for the current user.

Upvotes: 9

Views: 2646

Answers (1)

Ana Betts
Ana Betts

Reputation: 74654

Environment.ExpandEnvironmentVariables(@"%SystemRoot%\Temp");

Be aware though, that temp directories are a significant possible security risk, as they can be used to attack other users via corrupting shared data.

Upvotes: 6

Related Questions