T Torgeir Bakken \(MVP\) Mar 20, 2004 #2 Allen said: I need a vbs script to delete a shortcut from the desktop Click to expand... 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
Allen said: I need a vbs script to delete a shortcut from the desktop Click to expand... 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