Link to home
Start Free TrialLog in
Avatar of Garry Shape
Garry ShapeFlag for United States of America

asked on

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.
Avatar of footech
footech
Flag of United States of America image

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.
Avatar of Garry Shape

ASKER

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?
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
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
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
Ok thanks, makes sense. delete with script then standardize with GP. best way to go . thanks