/bundles/itninjaweb/img/Breadcrumb_cap_w.png
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   [ - ] Hide Comments

Comments

Please log in to comment

Answer this question or Comment on this question for clarity

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 Green Belt

Please log in to comment