Solved

Environment variable for C:\Documents and Settings\All Users\Application Data

Posted on 2007-11-14
5
6,669 Views
Last Modified: 2010-04-21
For Windows, how can I get the path:

C:\Documents and Settings\All Users\Application Data

via an environment variable?

"%ALLUSERSPROFILE%" gets me to: C:\Documents and Settings\All Users but I need: C:\Documents and Settings\All Users\Application Data

Any ideas?
0
Comment
Question by:acrocat
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:MorDrakka
ID: 20287245
Hi,

You can use: %ALLUSERSPROFILE%\Application Data\ or create one environment variable of your own.

Hope this helps.
0
 

Author Comment

by:acrocat
ID: 20287275
Problem is that \Application Data is not "Application Data" on a French or Italian machine etc... so that solution doesn't scale to other versions of the OS.
0
 
LVL 6

Accepted Solution

by:
MorDrakka earned 500 total points
ID: 20287324
Hi,

After extensive searching, I have come to the conclusion that "C:\Documents and Settings\All Users\Application Data" is no standard environment variable. So you can either set is as one, or find out which language the OS is in your script.

Maybe something like:

If Exist %ALLUSERSPROFILE%\Application Data\  echo English
If Exist %ALLUSERSPROFILE%\Application Data(en Francais)\  echo French
Instead of the echo i wrote here, you can do some action you want to do in your script.

M.
0
 

Author Closing Comment

by:acrocat
ID: 31409288
Yep - looks like this is the best/only way.

Thanks!
0
 

Expert Comment

by:janpjens
ID: 22139966
In case anyone else are looking for a way to retrieve localized version of %ALLUSERSPROFILE%\Application Data:

You could retrieve the value of %APPDATA%, substring anything after the last \ and append it to %ALLUSERSPROFILE%, then store this in a new environment variable, say %ALLUSERSAPPDATA%.
I know it's not nice, but it should do the trick.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question