Skip to main content
Question

Place a hidden file in a Users Library folder


Forum|alt.badge.img+5

Hello,

What is the easiest way to drop a folder or a file in a users Library folder? I would like to drop a whole folder in, maybe a 1 MB folder, or just place a .file in a specific folder. The only catch is the folder needs to already exist with option 2, with option 1 it shouldn't matter.

I can use composer to make the DMG/PKG if needed or leave it as a folder/file.

Thanks!

2 replies

Hugonaut
Forum|alt.badge.img+15
  • Esteemed Contributor
  • 574 replies
  • November 3, 2018

Personal opinion on the best 2 ways to skin this cat. IF YOU HAVE A WEB SERVER - YOU CAN DO OPTION 1. If not, Do Option 2.

Option 1: Make a script in your Jamf Pro Dashboard & Deploy it as a policy

#!/bin/bash

#Creates Directory in Users Library
mkdir /Users/USER/Library/NewFolder

#Downloads File to Directory in Users Library
curl -o /Users/USER/Library/NewFolder/NewFile http://server.institution.com/FolderPath/**NewFile**

#Hides the newly created directory in Users Library
chflags hidden /Users/USER/Library/NewFolder

#Dictate Files Owner & Permissions
chmod ### /Users/USER/Library/NewFolder/NewFile 
chown user:group /Users/USER/Library/NewFolder/NewFile

Option 2: Create a Package and deploy it in a policy.


Forum|alt.badge.img+5
  • Author
  • Contributor
  • 33 replies
  • November 4, 2018

Thanks @Hugonaut


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings