Solved

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

Posted on 2014-12-11
6
728 Views
Last Modified: 2014-12-15
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
Comment
Question by:Swaroop Katargunde
6 Comments
 
LVL 25

Expert Comment

by:Mohammed Khawaja
ID: 40493491
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
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40493529
the root of c: is a protected area use a subfolder instead
0
 

Author Comment

by:Swaroop Katargunde
ID: 40493541
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 24

Expert Comment

by:VB ITS
ID: 40493669
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
 
LVL 6

Accepted Solution

by:
Rob G earned 500 total points
ID: 40495005
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
 
LVL 3

Expert Comment

by:v_2abhis2
ID: 40497402
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now