Script to delete a program directory and associated .lnk "Shortcut" from the desktop

I have a quick question regarding removing a .lnk file off a desktop.  I created a basic script to detect an executable file for a local "In house" app we made here at my company that will delete the directory if it's detected.  That part works fine however it leaves the "Shortcut" ....the .lnk file on the desktop of the users desktop and if they want they have the ability to double click on that and have it re-update / thus reinstalling the app from our server.  How would I target that shortcut / .lnk file on the user's profile desktop and delete it without being specific regarding a username profile?  I'm trying to just create a script I can use across numerous devices and really don't want to have to edit each script just to change the profile "Username" so it works for each individual user.  Is this possible?  Is there a variable I have to use or maybe some sort of search and destroy feature I could program into a bat file to do this rather than relying on looking in the users folder specifically?  


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ