?
Solved

Copying files and running batch files with sccm

Posted on 2011-05-10
3
Medium Priority
?
8,117 Views
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.
0
Comment
Question by:WNottsC
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
merowinger earned 2000 total points
ID: 35726603
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
0
 

Expert Comment

by:techjunkyjosh
ID: 35729126
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

0
 
LVL 31

Expert Comment

by:merowinger
ID: 35827111
Any update?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This is my 3rd article on SCCM in recent weeks, the 1st (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html) dealing with installat…
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 is around source server preparation. No migration is an easy migration, there is a…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

864 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