home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 October / PCWorld_1999-10_cd1.bin / Software / Vyzkuste / Tajne / tajne.exe / shell / folder.vbs next >
Text File  |  1999-02-12  |  1KB  |  56 lines

  1. Set WSHShell = WScript.CreateObject("WScript.Shell")
  2. set shell = wscript.CreateObject("Shell.Application")
  3. Shell.MinimizeAll
  4. Dim cFolder
  5. rFolder = BrowseForFolder("Choose Left Panel folder to open:")
  6.  
  7. Dim dFolder
  8. lFolder = BrowseForFolder("Choose Right Panel folder to open:")
  9.  
  10. shell.Open lFolder
  11. shell.Open rFolder
  12.  
  13. wait(2) 
  14.  
  15. Shell.TileVertically
  16.  
  17. WSHShell.popup "Restore Desktop"
  18. Shell.UndoMinimizeAll 'Undoes tile only, folders remain
  19.  
  20. Function BrowseForFolder(strPrompt)
  21. On Error Resume Next
  22. Dim objShell, objFolder, intColonPos, objWshShell
  23. Set objShell = WScript.CreateObject("Shell.Application")
  24. Set objWshShell = CreateObject("WScript.Shell")
  25.  
  26.  
  27. Set objFolder = objShell.BrowseForFolder(&H0&, strPrompt, &h1&)
  28.  
  29. BrowseForFolder = objFolder.ParentFolder.ParseName(objFolder.Title).Path
  30.  
  31.  
  32. If Err.Number <> 0 Then
  33.   BrowseForFolder = Null 
  34.  
  35.   If objFolder.Title = "Desktop" Then
  36.    BrowseForFolder = objWshShell.SpecialFolders("Desktop")
  37.   End If
  38.  
  39.   intColonPos = InStr(objFolder.Title, ":")
  40.  
  41.   If intColonPos > 0 Then
  42.    BrowseForFolder = Mid(objFolder.Title, intColonPos - 1, 2) & "\"
  43.   End If
  44. End If
  45. End Function
  46.  
  47. Sub Wait(x)
  48.     dim Start, i
  49.     Start = cint(second(time))
  50.     i = 0
  51.     Do
  52.         i = i + 1
  53.     loop While cint(second(time)) < Start + cint(x)
  54.   End Sub
  55.  
  56.