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

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

A VBS that will copy a file from server to c:\windows\system32 on client's pc

Basically I want a command that will copy a file from a server to c:\windows\system32 on client's pc

There are 250+ pcs and I want to run a log in script from GPO.

I have asked this question a few weeks back but noone was able to help me with.  There was an issue with permission on c:\windows\system32 on local machine that prevented a file from being copied to.

  • 2
1 Solution
Lee W, MVPTechnology and Business Process AdvisorCommented:
What you're trying to do - must it be done with a login script?  Is the goal simply to put a file on the local PC for later use/reference?

If so, I can suggest/write alternatives for this.
cooljam23Author Commented:
Ok  we're trying to put a wallpaper file (bmp) on to client's pc in c:\windows\system32 and then we can set the GPO to point to c:\windows\system32\file.bmp

I don't know of any other way off copying the file from the server to c:\windows\system32 with the proper rights

Log in batch file won't do this because of the permission issues.

Lee W, MVPTechnology and Business Process AdvisorCommented:
A DOS command (using a few other dos commands) should be able to do this:

for /f "tokens=1" %a in ('net view ^| find "\\"') do @copy /y "\\server\share\path\source.bmp" "%a\admin$"

This relies on all workstations being visible to the "net view" command - which also means they must be booted.  As long as the script is run by an Admin, it should work fine, provided you haven't removed administrative shares on the clients.

If you want to put this into a DOS Script, make sure to double the % signs - %%a instead of %a.

You can also have a script that runs longer and records each machine successfully copied to, another version that copies by IP Address instead of computer name.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now