home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch20 / scripts / dtop.vbs < prev    next >
Encoding:
Text File  |  1998-05-09  |  419 b   |  13 lines

  1. ' This script displays all files on the desktop,
  2. ' along with their types
  3. Set FSys = CreateObject("Scripting.FileSystemObject")
  4. Set WShell = Wscript.CreateObject("Wscript.Shell")
  5. DTOPfolder = WShell.SpecialFolders("Desktop")
  6.  
  7. Set Desktop = FSys.GetFolder(DTOPfolder)
  8. Set DesktopFiles = Desktop.Files
  9. For Each file in DesktopFiles
  10.     txt = txt & file.Name & "  (" & file.Type & ")" & vbCrLf
  11. Next
  12. MsgBox txt
  13.