Link to home
Create AccountLog in
Avatar of DynCorp
DynCorpFlag for United States of America

asked on

I need a script or batch file that will autorun at startup and will delete specific desktop icons

I need a script or batch file that will autorun at startup and will delete specific desktop icons that are placed on my desktop by group policy.  I am an admin on the local machine.  I need to be able to edit it the first time, so I can point it to the specific desktop icons.
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Where are the icons coming from... if you look in the details tab (Vista) or General tab (XP/2000) it should show you the path the icon comes from.

All you need to do then is delete the .LNK file that is the relevant icon with a

del "C:\users\stephen\desktop\whatever.lnk" 2>NUL

in a text file and call in delicons.cmd or whatever

The 2>NUL stops any errors showing

You may be able to use wither

"%allusersprofile%\desktop"
or "%userprofile%\desktop"

rather than being specific.

If the icons isn't 'real' as such, i.e. doesn;t exist as a file such as MS Outlook, Internet Explorer etc. then that is a different matter, if so what are they?

Steve
SOLUTION
Avatar of Shanmuga Sundaram D
Shanmuga Sundaram D
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of DynCorp

ASKER

Sorry I was on vacation.  I'll check these out and get back to you, thanks for all the info guys.
No problem.  Let us know how you go.

Regards,

Rob.