script to add favorites during mdt task sequence

I need a script to copy the .lnk files to C:\Users\Default\Favorites during the MDT 2010 task sequence for my images.
LVL 1
tfgeorgeAsked:
Who is Participating?
 
RobSampsonCommented:
OK then, I think you'll be stuck with a bit of workaround solution.

Create a folder, in C:\Windows or something, callled AllUsersFavorites, or whatever you like to call it.

Put your favorite links in there.

Then, place a script in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

that has this code in it:
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strAllUsersFavorites = "C:\Windows\AllUsersFavorites"
strCurrentUserFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites"
If Right(strAllUsersFavorites, 1) = "\" Then strAllUsersFavorites = Left(strAllUsersFavorites, Len(strAllUsersFavorites) - 1)
If Right(strCurrentUserFavorites, 1) = "\" Then strCurrentUserFavorites = Left(strCurrentUserFavorites, Len(strCurrentUserFavorites) - 1)
objFSO.CopyFile strAllUsersFavorites & "\*", strCurrentUserFavorites & "\", True

Open in new window


Then, whenever anybody logs in, the files will be copied from the folder you created, to the Favorites folder of each user.

Regards,

Rob.
0
 
RobSampsonCommented:
Where do you have the .lnk files stored?  If they're on a network share, try a batch file like this
xcopy /s /y \\server1\share\favorites\*.* c:\users\default\favorites\

Rob.
0
 
tfgeorgeAuthor Commented:
C:\users\default\favorites\ does not work for favorites in windows 7. I have no idea why they did this.

0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
RobSampsonCommented:
What about c:\users\public\favorites\?
0
 
tfgeorgeAuthor Commented:
Rob- I just tried that and it didn't work.
0
 
RobSampsonCommented:
Which part of it didn't work?  The file copy, or the fact that the Favorites from "All Users" didn't appear for any user account?
0
 
tfgeorgeAuthor Commented:
Sorry. When I add a favorite to c:\users\public\favorites it doesn't show up
0
 
tfgeorgeAuthor Commented:
When I add the same file to the favorites folder of a user it works fine.
0
 
RobSampsonCommented:
I cannot figure out how to get the files there to work.  Are you on a domain? Can you use Group Policy:
http://mctexpert.blogspot.com/2011/04/use-group-policy-to-populate-ie.html

Rob.
0
 
tfgeorgeAuthor Commented:
Off domain client. GP will not do.
0
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.

All Courses

From novice to tech pro — start learning today.