Advertisement
absolutereality

Backup/restore open windows

Jan 18th, 2022
1,172
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. title Create a backup of open folder windows
  3. setlocal enabledelayedexpansion
  4.  
  5. powershell  @^(^(New-Object -com shell.application^).Windows^(^)^).Document.Folder.Self.Path >> prevfolderpaths.txt
  6.  
  7. FOR /F "tokens=*" %%f IN (prevfolderpaths.txt) DO (
  8.  
  9. set "var=%%f"
  10. set "firstletters=!var:~0,2!"
  11.  
  12. IF "!firstletters!" == "::" ( ECHO start /min shell:%%~f >> foldersession.bat) ELSE ( ECHO start /min "" "%%~f" >> foldersession.bat)
  13.  
  14. )
  15.  
  16. del "prevfolderpaths.txt"
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement