Jump to content
Sign in to follow this  

Run script function as location admin?

Recommended Posts

Wondering if there is a way to insert the location designated Admin username as a variable, OR run a function "as admin".  Specifically, working with and If File Exists check, but it's a file that usually exists under a user's appdata folder.  (Chrome installer log for now.)  3PP via Automate, drops it into the temp folder for the location admin.  I'm trying to build a simple script to just grab the logs - but don't want to make a copy of the script for every location (different admin accounts.)


I did try "%systemdrive%\users\%adminusername%\appdata\local\temp\", but it just leaves a blank space for the adminusername.  trying %admin right now.  It'd all be easier if I could just do the file check 'as admin' of course.

(The installation runs under the assigned local user account, but the IF file exists check runs under SYSTEM - so the %temp% variable won't expand to the right path.)




Share this post

Link to post
Share on other sites

Just thinking out loud.  Could use File Copy as admin perhaps, to copy it from the %temp% to windows\temp, and then just pick it up from there, perhaps.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this