Remove multiple versions of OneDrive as logged on user

Ah, yeah.
The logged-on user doesn’t have permission to the BESData directory where the uninstall.cmd is, so the user can’t run the script.

See the notes in my tip at Tip - Action Override User settings about copying the uninstall to a UserFolder parameter for more details.

It’ll be something like

parameter "UserFolder"="{(preceding text of first "|" of it | it) of concatenation "|" of profile folders of users of logged on users whose (active of it)}\MyBESContent\{id of action as string}"
Folder create "{parameter "UserFolder"}"
 Copy __appendfile "{parameter "UserFolder"}\uninstall.cmd"
// Override options here
Run CMD.exe /c "cd "{parameter "UserFolder"}" & uninstall.cmd"

That creates a folder for the script, in a directory the user can access, and copies the script there. Then the CMD shell running as the user changes directory to that folder before running the uninstall.cmd

1 Like