?
Solved

script to add favorites during mdt task sequence

Posted on 2011-10-27
10
Medium Priority
?
1,393 Views
Last Modified: 2012-08-13
I need a script to copy the .lnk files to C:\Users\Default\Favorites during the MDT 2010 task sequence for my images.
0
Comment
Question by:tfgeorge
  • 5
  • 5
10 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 37054110
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
 
LVL 1

Author Comment

by:tfgeorge
ID: 37056351
C:\users\default\favorites\ does not work for favorites in windows 7. I have no idea why they did this.

0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37060347
What about c:\users\public\favorites\?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 1

Author Comment

by:tfgeorge
ID: 37066268
Rob- I just tried that and it didn't work.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37066389
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
 
LVL 1

Author Comment

by:tfgeorge
ID: 37066393
Sorry. When I add a favorite to c:\users\public\favorites it doesn't show up
0
 
LVL 1

Author Comment

by:tfgeorge
ID: 37066401
When I add the same file to the favorites folder of a user it works fine.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 37067265
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
 
LVL 1

Author Comment

by:tfgeorge
ID: 37147642
Off domain client. GP will not do.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 37149120
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

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question