Link to home
Start Free TrialLog in
Avatar of BradleyCleveland
BradleyCleveland

asked on

copy file to system32 folder of workstations

As part of my server logon script, I want to be able to copy a file from the server to the system32\Drivers\etc folder on the local workstation. My vbs script using filesystemobject copyfile works great as long as the person logs in is an administrator where they have read/write/modify permissions on that folder, but fails for someone with read only permissions. How can I copy this file to the workstation on logon?
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

Change it from a logon script to a startup script under the machine configuration. The script will run the next time the machine boots.
You could make use of Group Policy Preferences to copy the file across too. You didn't say whether this was the same file every time, or whether the source changes.
Avatar of BradleyCleveland
BradleyCleveland

ASKER

The destination file is always the same.  C:\windows\system32\drivers\etc\hosts.
The source file will vary depending on the AD group of the employee logging in.
ASKER CERTIFIED SOLUTION
Avatar of kevinhsieh
kevinhsieh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What I am doing is copying restricted copy of the hosts file on machine startup (doesn't matter who logs in). then only if an employee with administrator access logs, I copy the unrestricted hosts file to the machine.  If anyone besides an administratror needs access to the blocked websites, then I will go to that machine, give them permissions on that folder and include them with administrators in my script to copy over the unstricted hosts file.  This plan isn't working as smoothly as I had hoped, but it will suffice for now until I get time to research internet policy software and decide what will work best for our agency