SCCM 2012 / Software Center / Copy published file to a folder under user profile

Hi, SCCM 2012 and Software Center.

I'm trying to get an optional file copied for users if they need it. The idea was to publish it through Software Center as available software as a simple file copy bat file. Depending on the software/OS version the file can end up in three different directories.

IF EXIST "C:\Program Files (x86)\Folder" (copy /y "file.xyz" "C:\Program Files (x86)\Folder")
IF EXIST "C:\Program Files\Folder" (copy /y "file.xyz" "C:\Program Files\Folder")
IF EXIST "%userprofile%\AppData\Local\Folder" (copy /y "file.xyz" "%userprofile%\AppData\Local\Folder")

First two work but I assume that SCCM runs the batch file with system context so that %userprofile% variable is not understood.
Is there any alternative way to copy the file to a folder under users profile folder?
TroubledWayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nagendra Pratap SinghDesktop Applications SpecialistCommented:
You can change it to run without using system context.

The first link mentions 2007 version but the concept is the same.

http://myitforum.com/myitforumwp/2013/11/13/copy-sccm-2007-programs-with-powershell/

http://blog.thesysadmins.co.uk/sccm-2012-allow-end-user-to-run-application-as-administrator.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TroubledWayAuthor Commented:
Sorry for the long delay. This looks like it could do the trick. Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.