Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1338
  • Last Modified:

How to copy a file from share drive to local users c:\ drive, through group policy

Hi,

Need help  to copy the file from share drive to local users c:\ drive, through group policy, while i using the below script it gives permission denied error. but it working fine with administrator login.

Below script work only with administrator rights.
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objName= CreateObject("wscript.network")
objFSO.CopyFile "\\mumfilesvr204.iksad.local\Install\Pac_files\proxy.pac" , "C:\proxy.pac" , OverwriteExisting

Please suggest. Thanks in advance.
0
Swaroop Katargunde
Asked:
Swaroop Katargunde
1 Solution
 
Mohammed KhawajaCommented:
Can the user copy it without running as Administrator?   If that is the case then you have the choice of disabling UAC or maybe the user doesn't have rights to create file in C:\.  Have you tried copying the file to %temp%\ folder as everyone has rights to temp folder.
0
 
David Johnson, CD, MVPOwnerCommented:
the root of c: is a protected area use a subfolder instead
0
 
Swaroop KatargundeAuthor Commented:
User doesn't have rights to copying the files rights.
I am using group policy -- logon script --to copy the file from share folder to users system i.e c:\
 Can you please suggest,
0
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.

 
VB ITSCommented:
Use Group Policy Preferences instead to copy the file: http://technet.microsoft.com/en-au/library/cc772536.aspx
 
Although I haven't tested this with copying files to the root of the C:\ drive before it should work as long as you don't tick the "Run in logged-on user's security context (user policy option)" as this will try and copy the file to the C: drive using the logged on user's account. If you leave this box unticked (which it is by default) it will run under the SYSTEM account which does have Full Access to the root of the C: drive.
0
 
Rob GCommented:
Does the person have access to the file location?
If not you will need to run the script from an account that does.. Which is easy to do, and i will write you a basic script to get this done, (you'll need to add your creds etc) but keep in mind that data is passed in clean text over the network..

Basically what i would do..


Net use F: \\Network path to the folder where the file is\  /User: administrator pa$$word /persistent:No
mkdir c:\filemove
Copy f:\File.txt c:\filemove\
copy c:\filemove\file.txt c:\
net use f: /D
del c:\filemove /s /q
end

Copying it to a sub folder local, then to C itself should allow you to bypass the UAC complaint about the the file failing..
0
 
v_2abhis2Commented:
Hello,

Try using the Group policy preference setting under the following location

Computer configuration - Preferences- Windows settings -file,

Now select the option replace in Action

Specify the share folder location using the UNC patch \\<servername>\sharename\<filename> in source file filed

C:\ <filename> in the destination file field.

this will copy the file over from the share to the local system c;\ drive

You can apply this policy on the OU or the domain
0

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.

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