Hi i need a vb script to delete a shourtcut inside the alluser profile startmenu
Add your rating:
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
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)
Please log in to answer
Posted by:
dchristian
13 years ago
Posted by:
package_aligator
13 years ago
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:
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
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.