/build/static/layout/Breadcrumb_cap_w.png

Deleting icon from Desktop in MI

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

Answers (1)

Posted by: rad33k 6 years ago
Fourth Degree Brown Belt
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

Don't be a Stranger!

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

Sign up! or login

Share

 
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