vbs script

  • Thread starter Thread starter Allen
  • Start date Start date
Allen said:
I need a vbs script to delete a shortcut from the desktop
Hi

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("scripting.FileSystemObject")

sShortCutName = "something.lnk"

sDesktopPath = oShell.SpecialFolders("Desktop")
sAllUsersDesktopPath = oShell.SpecialFolders("AllUsersDesktop")

On Error Resume Next ' suppress error if the file do not exist
oFSO.DeleteFile sDesktopPath & "\" & sShortCutName, True
On Error Goto 0


WSH 5.6 documentation (local help file) can be downloaded from here if you
haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

"Open With" problem 2
VBS script question 3
VBS Scripts 29
vbs script wshshell.exe error 0
vbs script in XP 9
sending email via the command line? 2
"eventquery.vbs problem" 1
running a vbs script 11

Back
Top