Scripting Question

Why does verifying a file exists when run as the logged in user using %localappdata% still run as the system and not the user?

11/03/2016 1161 views
I am trying to create a script in Kace K1000 to check if OneDrive for Business is installed on a computer. In order to do this, I would like to check that the file exists, however the file is located in the local users appdata. When I run the script as the logged in user, and search for %localappdata%\Microsoft\OneDrive\OneDrive.exe it searches here instead C:\windows\system32\config\systemprofile\AppData\Local\Microsoft\OneDrive\OneDrive.exe  which means it's running as the system still. Is this a bug in Kace? Or is there a better way to search the local appdata of a user? Any help would be appreciated.
Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author

Surely there'll be a registry entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode] | [ProductName]? WSouldn't that be a simpler thing to search for?
Answered 11/09/2016 by: VBScab
Red Belt

  • That is actually what I ended up doing, thanks!

All Answers

What version is your kbox?  Yes there is a bug with some versions


Good news, it is fixed in Version 7 so sit tight for that release.

Answered 11/03/2016 by: SMal.tmcc
Red Belt

  • This is exactly what I was hoping for, thanks for the response!

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ