Jump to content


mrdk83

Copy files to SCCM Client

Recommended Posts

I need to copy a large file to multiple client SCCM (Server - SCCM 2012R2, Client - Windows Server 2008R2). Simply copy. How can this be done easily? Well if it was possible to enable reporting on whether the file is copied?
I thought about PowerShell command Start-BITSTransfer but there is no reporting.
The second idea is to use robocopy. The file is copied but the Task Sequence ends with an error.
You know a quick and simple way? Some locations have poor bandwidth.

In addition, I wanted to ask how to use the TaskSeqeunce parameter "%~dp0" ?

Share this post


Link to post
Share on other sites

%~dp0 is an identifier signifying "wherever this file lives" that's typically used in .cmd/.bat files.

 

E.g. you've got a script that runs an install routine with a .msi file, then copies another file - all three of these live in the same folder. You want to make it so that if the files get moved, or if they're accessed with different methods (unc path vs drive letter), stuff will just keep working.

 

Using Flash Player as an example:

%~dp0install_flash_player_16.0.0.305_active_x.msi /qn
copy %~dp0mms.cfg %systemroot%\System32\Macromed\Flash\
if exist %systemroot%\SysWOW64\Macromed\Flash\ copy %~dp0mms.cfg %systemroot%\SysWOW64\Macromed\Flash\

First line says "run the file that lives in the same folder that this script does named install_flash_player_16.0.0.305_active_x.msi"

Second line says "copy the file that lives in the same folder that this script does named mms.cfg to %systemroot%\System32\Macromed\Flash\"

Third one does the same as the second for a 64-bit version of windows.

 

So you can run this from

\\server\share\Flash\16\FlashInstaller.cmd

N:\Flash\16\FlashInstaller.cmd (assuming N:\ is mapped to \\server\share)

D:\shares\Apps\Flash\16\FlashInstaller.cmd (if you want to run it on the server that's hosting the share)

or you can move all three files to \\someOtherServer\someOtherShare and run from there, without having to change the paths in the script.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.