Solved

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

Posted on 2014-12-11
6
948 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 81

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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
An article on effective troubleshooting
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

710 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