[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2014-08-21
Medium Priority
Last Modified: 2014-09-16
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?
Question by:TroubledWay
LVL 24

Accepted Solution

Nagendra Pratap Singh earned 2000 total points
ID: 40277638
You can change it to run without using system context.

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



Author Closing Comment

ID: 40325899
Sorry for the long delay. This looks like it could do the trick. Thank you!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve DNS query failed errors for Exchange
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question