alanpearce
asked on
Roaming Profiles & Icons for Locally Installed Programs
I am using roaming profiles in a W2K network. All of the workstations are identical with regard to hardware, and are virtually clones with regard to installed software and configuration. A few machines, however, have software installed on them that is not installed on other machines. At present, the desktop shortcuts for these applications are placed in the All Users profile. However, I would like for the shortcuts to only appear to specific users. The problem is, if I place the shortcuts in the users' profiles, they show up on any machine they log into, even if the application is not installed. This tends to confuse some of my users, who assume that if the icon is there, the program should run. Is there a way to hide the desktop shortcut if the target file does not exist?
ASKER
I was thinking that batch files would be way to do this, and I could deploy them easily enough through Group Policy. What should the scripting be, however.
Ah, was wondering if you were gonna ask this. Actually thought about on Saturday while driving over to my girlfriends. I really need to get a life. Anyway, this is what I would probably do for it:
### Script for moving inactive icons off the desktop. ###
#
#
# Move all the icons that were inactive on to the desktop again
# Or create the folder if it doesn't already exist
#
IF NOT EXIST "c:\documents and settings\%username%\deskto p\Inactive \" mkdir "c:\documents and settings\%username%\deskto p\Inactive \"
move /y "c:\documents and settings\%username%\deskto p\Inactive \*.*" "c:\documents and settings\%username%\deskto p"
#
# Now we move in the icons that are inactive on this machine
#
IF NOT EXIST "C:\Program Files\Microsoft Office\OFFICE11\winword.ex e" DO move /y "c:\documents and settings\%username%\deskto p\Microsof t Office Word 2003.lnk" "c:\documents and settings\%username%\deskto p\Inactive \"
Ok that line wrapped, but you should get the gist of it. That checks to see if MS Word exists. If it doesn't then it moves the Word icon (the default name of it) to the Inactive folder. Anyway, this should give you a pretty good idea of how to go about it. Let me know if you need anything else.
### Script for moving inactive icons off the desktop. ###
#
#
# Move all the icons that were inactive on to the desktop again
# Or create the folder if it doesn't already exist
#
IF NOT EXIST "c:\documents and settings\%username%\deskto
move /y "c:\documents and settings\%username%\deskto
#
# Now we move in the icons that are inactive on this machine
#
IF NOT EXIST "C:\Program Files\Microsoft Office\OFFICE11\winword.ex
Ok that line wrapped, but you should get the gist of it. That checks to see if MS Word exists. If it doesn't then it moves the Word icon (the default name of it) to the Inactive folder. Anyway, this should give you a pretty good idea of how to go about it. Let me know if you need anything else.
Crap. Take that DO out of the IF NOT EXIST regarding the program. So, that last line should read:
IF NOT EXIST "C:\Program Files\Microsoft Office\OFFICE11\winword.ex e" move /y "c:\documents and settings\%username%\deskto p\Microsof t Office Word 2003.lnk" "c:\documents and settings\%username%\deskto p\Inactive \"
IF NOT EXIST "C:\Program Files\Microsoft Office\OFFICE11\winword.ex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just following up to see if that script worked for you or not. Thanks.
ASKER
Worked like a charm! I did make a small change in the location of the "Inactive" directory, moving it up a level from the Desktop dir, so it wouldn't show on the desktop.
Yeah, that was just an example of where it could go. Glad it worked and solved the problem.
Anyway, I just can't think of a good way to do it other than what I wrote above. Good question though.