Question : Batch or VBScript to add a shortcut to Desktop for certain users

Hi..
I've been searching EE but I can't seem to find exactly what I need.

I have a shortcut http:\\Imp that I need to place on certain users desktop.  These users may be part of group or may not be part of a group so I am not easily able to use AD.  
Is there a way with VBScript or Batch file that I can add this shortcut to specific users, where the users are in a text file?

Thanks.

Answer : Batch or VBScript to add a shortcut to Desktop for certain users

In general yes, but I always recommend testing on a machine or two first.

Though let me revise the command - the one posted most recently puts the shortcut on the desktop of all users for the machine in question.  but if we don't want ALL users of a given machine to see it, then we should copy it to the user's roaming profile WHILE THEY ARE LOGGED OUT (this is why I hate roaming profiles - if they used folder redirection, this wouldn't be an issue and would be faster on the network)  Do this at night or on a weekend or early before they arrive;

For /f "tokens=1" %%a in (users.txt) do if "%%a"=="%username%" copy "x:\path\to\shortcut.lnk" "\\RoamingProfilesServer\ProfileShare\UserName(IfApplicable)\Desktop"

NOTE: I'm using plain old copy - NOT xcopy.  XCOPY can work, but why bother?

If you need more help with this, I'd recommend posting the EXACT name of the file the shortcut is - and it's path, as well as an example path to one of the users profiles.
Random Solutions  
 
programming4us programming4us