VBScript to copy all files from one network folder to a local folder
Posted on 2012-08-16
After a trawl of the internet, I'm struggling to find/adapt a suitable script that will copy all files from a network folder to a users local profile.
For example, this code works perfectly fine:
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\srv-fp01\d$\Public\Shortcuts\*.*" , "c:\test\" , OverwriteExisting
However, what I would like to achieve is for the destination folder to be this:
If I try this, then I get a vb error (Path not found). I know the source is OK but I am guessing that the %username% is throwing a spanner in the works.
As you probably can tell, I'm no good at VBScripts ;-)
What I am trying to do is when a user logs on, the vbscript fires and copies urls into their favourites bar...
Thanks in advance!