Accessing %appdata% of current user

Topics: Configuration Issue
Jul 28, 2016 at 1:15 PM
Hi there!
I'm trying to install Greenshot by WPP, which works perfectly. The only thing I can't get to work is the following:

Our users don't have local admin rights on the clients, so the updates are installed by another user in the background.
I have to delete a file under the %appdata% folder of the current user. I'd like to use the "Allow to Copy, Delete or Rename Files" action for this. The problem is, that if I run that it wouldn't delete the file in the direction of the current user, but in the one of the administrator.

Is there any way to archive deleting of files in that directory by WPP?

Jul 29, 2016 at 9:49 AM
The hard part is to get the current logon user. What happens if the update is installed when nobody is logon on (scheduled install or "at shutdown") ?

If there is someone currently logged, you can try this VBScript

Once you have the login of the user, you have to browse : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
and compare the content of the value : ProfileImagePath with the login of the current logon user. Once found, you have the "Home Folder" for this user.

Good luck !