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?
Be the first to answer this question