Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim Shell, FSO, DesktopPath
- Dim objShortcutFile, objDesktopFolder, objDesktopSubFolder, Folder, strSysDrive
- Set Shell = CreateObject("WScript.Shell")
- Set FSO = CreateObject("Scripting.FileSystemObject")
- strSysDrive = Shell.ExpandEnvironmentStrings("%SystemDrive%")
- Set Folder = FSO.GetFolder(strSysDrive & "Users")
- msgbox Folder & "sample1.lnk"
- For Each objDesktopFolder in Folder.SubFolders
- If FSO.FileExists(Folder & "sample1.lnk") Then
- FSO.DeleteFile Folder & "sample1.lnk"
- msgbox "success"
- Else
- msgbox "not existing"
- End If
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement