Copying files and running batch files with sccm

Posted on 2011-05-10
Last Modified: 2013-11-21
I would like to copy some files to a C:\temp folder on the local machine as part of the OS deployment but also be available as a stand alone package deployment.  I have seen lots of examples but I am still a little confussed as to how to do this.  I would also like to do the same with a batch file but one thing at a time.
Question by:WNottsC
    LVL 31

    Accepted Solution

    1. Create a batch file copy.bat with your copy command. e.g.
    xcopy test.txt C:\temp
    The file test.txt should be located in the same folder as the copy.bat
    2. Create a new SCCM Package and point it to the path of the copy.bat and test.txt
    3. Create a program in the Package with the command line: cmd /c copy.bat#
    4. Now you can deploy the program standalone or link it in a task sequence with a "install software" task sequence step

    Expert Comment

    I use the following batch file to copy an exe to the system32 folder on every pc on my domain.

    @echo off
    xcopy /y %~dp0program.exe %systemroot%

    Replace program.exe with the file you want to copy over. you can also modify the target by changing %systemroot% to the folder you desire. Then on the SMS server create a folder and put the files you want to deploy along with the batch file all in the same folder. Then have an sms program run the batch file. The batch file will look in the same folder for the files to copy over. If you have multiple files you can repeat the command in the batch file.
    @echo off
    xcopy /y %~dp0program.exe %systemroot%

    Open in new window

    LVL 31

    Expert Comment

    Any update?

    Featured Post

    Are your corporate email signatures appalling?

    Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

    Join & Write a Comment

    On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
    Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found here: http://www.experts-exchang…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now