Need help with a VBScript
Posted on 2003-11-12
Hello all, what I need is a VBScript or just a function for that matter but it has to work in a .vbs file.
What I need it to do is take an argument that is a path to a specific directory on my server. Within that directory there are subfolders and files. I need to look for specific files and when they are found I need to overwrite them with the updated version of these files. The directory structure is different on each server but the path is always the same. What I'm am doing is updating icon files for office programs. Our GPO's in the domain control what the user has for icons on their desktop so there are stored on the server. We are about to upgrade to Office 2003 so the icons need to be updated as well. So the script has to be able to read through the directory where we keep them and when it finds them replace them with the newer version. A function would work better because I have to do it for Word, Excel, PowerPoint, ect... and it would be easier if I could pass the function the argument of which one I'm looking for.
Public Sub changefile(path, file)
searchfolder(path) for (file)
If (file) exsist then overwrite with (newfile)
else exit sub
Do until there are no more files to change
Obviously this isnt proper code it was just to help show what I need it tp do.
Points go to the first code that works.