/build/static/layout/Breadcrumb_cap_w.png

KACE Product Support Question


Deleting icon from Desktop in MI

02/24/2018 886 views
I have a batch file setup to delete our old VPN software and install our new VPN software and add a new shortcut.  Everything is working great within the batch file besides deleting the old shortcut from the desktop in MI.  Is there a trick to get this to work in MI?  If I run in cmd it works just not within my batch in MI. 

del "%userprofile%\Desktop\VPN Client.lnk"

Thanks 
0 Comments   [ + ] Show comments

Comments


All Answers

1
This is because you MI is started in system context and %userprofile% is resolved to C:\Windows\System32\config\systemprofile\

Fortunately DEL command allows to use a wildcard, so you can remove the shortcut from each user's profile with just one command:

DEL "C:\USERS\*VPN Client.lnk" /S /F /Q
Answered 02/25/2018 by: rad33k
Fourth Degree Brown Belt

 
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