Trying to delete a desktop .lnk in windows7

(imported topic written by ops1asg)

Here is the action script which works with WINXP and WIN2003. In windows 7 this doesn’t work.

Does anybody know how I can delete the desktop icon with a variable in WIN7?

//Delete Desktop icon

delete “{pathname of files whose (name of it equals “Adobe Reader 9.lnk”) of folder (value of variable “allusersprofile” of environment & “\Desktop”)}”

(imported comment written by danilor20)

Hello,

In Windows 7 Desktop icons are stored in a different location. The all users desktop is no longer in the “allusersprofile” folder but instead it is located in the C:\Users\public\Desktop folder. I believe if you use the script below it will work, I modified your variable to “public” instead of “allusersprofile”

//Delete Desktop icon

delete “{pathname of files whose (name of it equals “Adobe Reader 9.lnk”) of folder (value of variable “public” of environment & “\Desktop”)}”

(imported comment written by ops1asg)

We have tried that one and it doesn’t work. Thanks

(imported comment written by SystemAdmin)

This one works like a charm in Win7

delete “{value of variable “PUBLIC” of environment}\Desktop\test.lnk”

just replace test.lnk by your link name