Hi everyone,

I`m trying to deploy Microsoft Word templates through K1000.
The problem i have is that i can copy the template file to the Kace download/packages folder with the built in script function.
From there i want to copy the Template.docm file to 

"Users/"username"/Library/Application Support/Microsoft/Office/User Templates/"

I have tried to run a copy.sh script with the cp command to the specified folder. But im not able to copy the file as root user since the destination is in the Users/currentuser/Library and root user doesnt have the rights to the folder.
I have also tried with sudo chmod +x to give the root user acees to the folder and then copy the file but with the same result.

Tried my script directly on the mac where it works perfectly since im logged in with the user himself.
So is there a way to run the script with the currently logged in user?

here is my script, im not really strong in scripting so please bear with me:


sudo chmod +x "~/Library/Application Support/Microsoft/Office/User Templates"

cp "~/Library/Application Support/Dell/KACE/data/kbots_cache/packages/kbots/59/Template.docm" "Users/$LOGNAME/Library/Application Support/Microsoft/Office/User Templates"

can anyone help me in this case?
Thank you

best regards,

1 Comment   [ - ] Hide Comment


  • I do not know much about MACs but couldn't you set the KACE script to run as the Logged On User? They should have the rights to their own folders.
Please log in to comment

Answer this question or Comment on this question for clarity


In my experience, running anything from K1000 should be done as root since you are doing administrative tasks that are modifying the system in question. I've been sort of fumbling through these scripts for a few years, so I have made them work just well enough for my needs. 

Here is a snippet of something I use to change something for every user on a system (useful when installing an app that needs certain files to exist in each user's local directory):

## Copy something to each user's profile
cd /Users
for i in $(ls -d *)
    if [ "$i" == "Shared" ]
        echo "We don't need to modify our shared directory."
        cp -a $(KACE_DEPENDENCY_DIR)/Template.docm /Users/$i/Library/Application\ Support/Microsoft/Office/User\ Templates/
        chown $i /Users/$i/Library/Application\ Support/Microsoft/Office/User\ Templates/Template.docm

Answered 09/09/2014 by: bknorr
Purple Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja