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 Chosen by the Author
Please log in to answer
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