Best way to copy folder to multiple PCs (group policy ideally)

We recently did an update of a software that will now require me to update the local files on 100+ PCs. (copy/paste folder from shared drive) The issues however are as follows -

1. The folder I want to copy has multiple subfolders with data, which seems to be an issue when using group policy (Computer Configuration>> Preferences>>Windows Settings>>Files>)
2. The alternate seems to be to use a script via xcopy or robocopy and push that via GP. However, I need to copy this folder to Program Files (x86) which requires elevated permissions, so I keep getting access denied errors.

Any idea how I can best handle this?

Thanks.
ruhkusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
I use elevate:
http://download.microsoft.com/download/f/d/0/fd05def7-68a1-4f71-8546-25c359cc0842/Elevation2008_06.exe

Which you can read about here:
https://technet.microsoft.com/en-us/library/2007.06.utilityspotlight.aspx


All you need is elevate.cmd and elevate.vbs from the Elevation folder.

Call like this:
"elevate.cmd" "Myupdate.Bat"

Open in new window



In case the link ever goes dead:

elevate.cmd:
:: //***************************************************************************
:: // ***** Script Header *****
:: // =======================================================
:: // Elevation PowerToys for Windows Vista v1.1 (04/29/2008)
:: // =======================================================
:: //
:: // File:      Elevate.cmd
:: //
:: // Additional files required:  Elevate.vbs
:: //
:: // Purpose:   To provide a command line method of launching applications that
:: //            prompt for elevation (Run as Administrator) on Windows Vista.
:: //
:: // Usage:     elevate.cmd application <application arguments>
:: //
:: // Version:   1.0.0
:: // Date :     01/02/2007
:: //
:: // History:
:: // 1.0.0   01/02/2007  Created initial version.
:: //
:: // ***** End Header *****
:: //***************************************************************************

@setlocal
@echo off

:: Pass raw command line agruments and first argument to Elevate.vbs
:: through environment variables.
set ELEVATE_CMDLINE=%*
set ELEVATE_APP=%1

start wscript //nologo "%~dpn0.vbs" %*

Open in new window


elevate.vbs:
' //***************************************************************************
' // ***** Script Header *****
' // =======================================================
' // Elevation PowerToys for Windows Vista v1.1 (04/29/2008)
' // =======================================================
' //
' // File:      Elevate.vbs
' //
' // Additional files required:  Elevate.cmd
' //
' // Purpose:   To provide a command line method of launching applications that
' //            prompt for elevation (Run as Administrator) on Windows Vista.
' //
' // Usage:     (Not used directly.  Launched from Elevate.cmd.)
' //
' // Version:   1.0.1
' // Date :     01/03/2007
' //
' // History:
' // 1.0.0   01/02/2007  Created initial version.
' // 1.0.1   01/03/2007  Added detailed usage output.
' //
' // ***** End Header *****
' //***************************************************************************


Set objShell = CreateObject("Shell.Application")
Set objWshShell = WScript.CreateObject("WScript.Shell")
Set objWshProcessEnv = objWshShell.Environment("PROCESS")

' Get raw command line agruments and first argument from Elevate.cmd passed
' in through environment variables.
strCommandLine = objWshProcessEnv("ELEVATE_CMDLINE")
strApplication = objWshProcessEnv("ELEVATE_APP")
strArguments = Right(strCommandLine, (Len(strCommandLine) - Len(strApplication)))

If (WScript.Arguments.Count >= 1) Then
    strFlag = WScript.Arguments(0)
    If (strFlag = "") OR (strFlag="help") OR (strFlag="/h") OR (strFlag="\h") OR (strFlag="-h") _
        OR (strFlag = "\?") OR (strFlag = "/?") OR (strFlag = "-?") OR (strFlag="h") _
        OR (strFlag = "?") Then
        DisplayUsage
        WScript.Quit
    Else
        objShell.ShellExecute strApplication, strArguments, "", "runas"
    End If
Else
    DisplayUsage
    WScript.Quit
End If


Sub DisplayUsage

    WScript.Echo "Elevate - Elevation Command Line Tool for Windows Vista" & vbCrLf & _
                 "" & vbCrLf & _
                 "Purpose:" & vbCrLf & _
                 "--------" & vbCrLf & _
                 "To launch applications that prompt for elevation (i.e. Run as Administrator)" & vbCrLf & _
                 "from the command line, a script, or the Run box." & vbCrLf & _
                 "" & vbCrLf & _
                 "Usage:   " & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate application <arguments>" & vbCrLf & _
                 "" & vbCrLf & _
                 "" & vbCrLf & _
                 "Sample usage:" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate notepad ""C:\Windows\win.ini""" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate cmd /k cd ""C:\Program Files""" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate powershell -NoExit -Command Set-Location 'C:\Windows'" & vbCrLf & _
                 "" & vbCrLf & _
                 "" & vbCrLf & _
                 "Usage with scripts: When using the elevate command with scripts such as" & vbCrLf & _
                 "Windows Script Host or Windows PowerShell scripts, you should specify" & vbCrLf & _
                 "the script host executable (i.e., wscript, cscript, powershell) as the " & vbCrLf & _
                 "application." & vbCrLf & _
                 "" & vbCrLf & _
                 "Sample usage with scripts:" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate wscript ""C:\windows\system32\slmgr.vbs"" –dli" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate powershell -NoExit -Command & 'C:\Temp\Test.ps1'" & vbCrLf & _
                 "" & vbCrLf & _
                 "" & vbCrLf & _
                 "The elevate command consists of the following files:" & vbCrLf & _
                 "" & vbCrLf & _
                 "    elevate.cmd" & vbCrLf & _
                 "    elevate.vbs" & vbCrLf

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NVITCommented:
Have you tried using xcopy or robocopy  from the Computer Configuration > Startup gpo?
0
ruhkusAuthor Commented:
Unless i'm doing something wrong, it doesn't work from the  Computer Configuration > Startup gpo because I need elevated permissions to copy files to Program Files (x86), which I don't believe I can trigger even a prompt from there.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

ruhkusAuthor Commented:
@Kyle Abrahams - Would I need to put this elevate script onto all the PCs first, or can it run from a shared location?
0
Kyle AbrahamsSenior .Net DeveloperCommented:
We run it from a shared location.  As long as the users can execute it you're fine.
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
1. The folder I want to copy has multiple subfolders with data, which seems to be an issue when using group policy (Computer Configuration>> Preferences>>Windows Settings>>Files>)
Why is this an issue? The preference is just XML. You can copy it to XML editor and add as many files as you want (within reason) and just copy and past it back into the GPO
0
ruhkusAuthor Commented:
Shaun, I'm not familiar with this solution (nor the most knowledgeable about XML).  Is there a link or some examples you could share?
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
This is a sample of the XML after adding one file
<?xml version="1.0"?>
<File clsid="{50BE44C8-567A-4ed1-B1D0-9234FE1F38AF}" name="Destination" status="Destination" image="2" changed="2018-03-23 17:09:41" uid="{B1D00E48-B823-4006-989D-1F1D5CC081DF}"><Properties action="U" fromPath="Source" targetPath="Destination" readOnly="0" archive="1" hidden="0" suppress="0"/></File>

Open in new window

0
ruhkusAuthor Commented:
The Elevate command worked, although I still ran into group policy issues, but that's a different story. The XML  suggestion was too complicated for me to figure out.

Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.