Update IE Favorite for all users in Windows 7

Does anyone know of a way to try and accomplish this?

Basically, I'm trying to make a script that when deployed to the computer, it will scan through the local C-Drive for any shortcut type of file called "VPN" which would most likely have the extension .url (the extension/format of an Internet Explorer favorite shortcut).

Then how can the script delete that .url and replace it with another shortcut ("New VPN.url" from a network share?

With PowerShell, I've got this so far:
Get-ChildItem C:\Users -Recurse | ? {$_.Name -like "*VPN*"}

But not sure if Powershell is the way to go and what to pipe this to, or, if maybe batch script is a better way to go which I'm not very familiar with.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

For deploying a URL I'd go with Group Policy Preferences.  Get rid of the existing one, then deploy a new shortcut with GPP.  It's then easy to update it at any time.
garryshapeAuthor Commented:
I think some people have the favorite stored in difference places though, like c:\users\%username%\favorites or sub-folder "Favorites bar", as well as maybe on their Desktop folder.

As for Group Policy, what could that do for me here as far as deleting old ones and adding a new one? Would it interfere with their other shortcuts, or make everyone have completely identical Favorites all together?
garryshapeAuthor Commented:
So maybe I can do something like:

$shortcuts = Get-ChildItem C:\Users -Recurse | where {$_.Name -like "*VPN*.url"}

Then how can you replace each file with another file
And that's one area where I would standardize.  You can deploy a shortcut (like on the Desktop), or you can deploy a Favorite, or both if really need be.  As far as deleting old ones (or modifying existing ones), GP may not help here, but you could try the "Update" action (I haven't played around with modifying an existing shortcut/Favorite that wasn't created by GP).  But deploying, and then subsequently updating, would be a snap.  It wouldn't interfere with any existing Favorites.  You may check this out for an example of using this.

You may just want to use a script like your line above and just delete each match, then use GPP to create the new one.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
garryshapeAuthor Commented:
Ok thanks, makes sense. delete with script then standardize with GP. best way to go . thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.