Advertisement
jcunews

ExpWndPaths.vbs

Jan 15th, 2023
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'ExpWndPaths v1.0.1, January 2023.
  2. '
  3. 'https://www.reddit.com/user/jcunews1
  4. 'https://pastebin.com/u/jcunews
  5. 'https://greasyfork.org/en/users/85671-jcunews
  6. '
  7. 'Script to retrieve folder paths used by Explorer windows and
  8. 'saves them into the clipboard, then display them in Notepad.
  9.  
  10. tt = "Explorer Window Folder Paths"
  11. s = ""
  12. for each sf in createobject("shell.application").windows
  13.   if left(typename(sf.document), 16) = "IShellFolderView" then
  14.     set fd = sf.document.folder
  15.     if s <> "" then s = s & vbcrlf
  16.     s = s & fd & ":" & vbcrlf & fd.self.path & vbcrlf
  17.   end if
  18. next
  19. if s = "" then
  20.   msgbox "No Explorer window is found.", 16, tt
  21.   wscript.quit
  22. end if
  23. set fs = createobject("scripting.filesystemobject")
  24. n = fs.getspecialfolder(2) & "\" & (timer * 100) & ".tmp"
  25. set f = fs.createtextfile(n, true)
  26. f.write tt & vbcrlf & vbcrlf & s
  27. f.close
  28. set ws = createobject("wscript.shell")
  29. ws.run "cmd.exe /c type """ & n & """|clip", 0, true
  30. fs.deletefile n
  31. if ws.run("cmd.exe /c start notepad.exe", 0, true) <> 0 then wscript.quit
  32. do while not ws.appactivate("Untitled - Notepad")
  33.   wscript.sleep 100
  34. loop
  35. ws.sendkeys "^v"
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement