copy file from network share to all windows users desktops on all network computers

JCBWS picture JCBWS · May 19, 2015 · Viewed 14.8k times · Source

Essentially, I would like to do something like this (using command prompt merely for a visual example, will gladly try PowerShell/VBScript/other programming methods)...

xcopy "\\thisserver\share\something.txt" "\\computer1\c$\users\dude\Desktop\*.*" /Y
xcopy "\\thisserver\share\something.txt" "\\computer2\c$\users\dudeette\Desktop\*.*" /Y
...

In fact, if I could take it a step further to simply the code, I would like to do something like this:

xcopy "\\thisserver\share\something.txt" "\\computer1\c$\*\*\Desktop\*.*" /Y
xcopy "\\thisserver\share\something.txt" "\\computer2\c$\*\*\Desktop\*.*" /Y

I know this is improperly coded, but essencially I would like to copy a file (.vbs file to be exact) from a easily accessible network location to all the Windows Users' (c:\users) desktop locations on all network computers within our domain.

Any help is greatly appreciated! If manually is the only option, then I guess that's how it is.

Answer

Ansgar Wiechers picture Ansgar Wiechers · May 19, 2015

In a domain it would be far simpler to use a Group Policy Preference for deploying files to user desktops.

GPP for file deployment

Press F3 with the cursor in the Destination File input box to get a list of available variables.