Avatar of chriswies
chriswies asked on

Get "C:\Documents and Settings\All Users\Application Data" folder with VB

How do I  get the "C:\Documents and Settings\All Users\Application Data"-folder in VB, VBA?
No problem to get the users dir, but not the All Users one. I need to get it to ensure correct folder names with international XP-Versions.
Chris
Visual Basic Classic

Avatar of undefined
Last Comment
codvir

8/22/2022 - Mon
Wayne Taylor (webtubbs)

Use this....
Environ("ALLUSERSPROFILE") & "\Application Data"

Open in new window

ASKER
chriswies

german:
Environ("ALLUSERSPROFILE") & "\Anwendungsdaten"

:-(
ASKER CERTIFIED SOLUTION
GrahamSkan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
chriswies

I actually found vba.environ but this is only for the users directory, not all users.
thanks
Chris
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
codvir

you can do the following:

System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)

it will get the folder you want,

Dvir