Archives Under "VBscript" (RSS)
fileupdater.vbs
30 March 2009 | Active Directory, Group Policies, VBscript | 2 Responses

I mentioned earlier that I’m using a loginscript to sync the pac files to the local drive, but didn’t upload it at the time. Here it is anyhow – it’s probably not the most elegant solution, nor the one with least code; but it works for me. Used with a GPO that sets the path locally, it’s a fairly flexible way of controlling internet access.
Basically, you call it like this:
fileupdater.vbs /i:input.txt /o:target.txt
The locations can be anything the vbScript FileSystemObject is able of accessing with the credentials running it – both local drives and unc-paths.
fileupdater.vbs
I also use the script to push any changes in the PAC file into the netlogon directory (runas domain admin):
C:\scripting>fileupdater.vbs /v /i:C:\conf\proxy.pac /o:\\%USERDNSDOMAIN%\netlogon\proxypriv.pac Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved. output file created: 27.03.2009 11:04:17 modified: 27.03.2009 11:17:15 input file created: 16.12.2008 03:24:19 modified: 28.03.2009 14:54:51 updating file