/build/static/layout/Breadcrumb_cap_w.png

Hi i need a vb script to delete a shourtcut inside the alluser profile startmenu

Hi
I need a vb script to delete a shourtcut inside the alluser profile startmenu
%ALLUSERSPROFILE%\STARTMENU\PROGRAMS\AAA\BBB\XYZ.URL

THIS IS WHAT THE SAMPLE PATH FOR THE SHORT,

Please any one give me the script

Thanks in advance

0 Comments   [ + ] Show comments

Answers (4)

Posted by: dchristian 13 years ago
Red Belt
0
I'm I missing something?....

Isn't this just:
del "%ALLUSERSPROFILE%\START MENU\PROGRAMS\AAA\BBB\XYZ.URL"

Save as a bat, and call it a day?
Posted by: package_aligator 13 years ago
Orange Belt
0
In case your calling the .bat from inside a CA it's not that pretty to see a command prompt pop-up for a second.
I would go for the vbs in the above scenario:


set oWsh = CreateObject("WScript.Shell")
set oFSO = CreateObject("Scripting.FileSystemObject")
shortcut = oWsh.ExpandEnvironmentStrings("%ALLUSERSPROFILE%") & "\Start Menu\Programs\AAA\BBB\XYZ.URL"

if oFSO.FileExists(shortcut) then
oFSO.DeleteFile(shortcut)
End If
Posted by: mazessj 13 years ago
Blue Belt
0
oWsh.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")

Ugh, why do you script guys still do this? The Common Programs folder is a known/"special" folder to vbscript. You should write your code to work with all modern versions of Windows, not just XP.

This might be a little dated now, but it's better than reading that environment variable:
http://msdn.microsoft.com/en-us/library/0ea7b5xe(v=vs.85).aspx
http://www.aspfree.com/c/a/Windows-Scripting/Writing-Portable-Scripts-in-WSH/3/
Posted by: anonymous_9363 13 years ago
Red Belt
0
why do you script guys still do thisFor the same reason why scripts contain ZERO error-trapping: ignorance.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
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