Hello, @gh-2017, @peterjones, @terry-r and All,
@gh-2017 :
I tried your batch file with few simplifications and it worked nice ! Thanks for sharing !
Now, here is a more simple version of what you expect to, which uses a tiny executable file, named mtrw.exe ( Instructions in comments )
@echo off REM -------------------------- IMPORTANT ----------------------------------- REM BEFORE executing this BATCH file : REM - DOWNLOAD the "mtr206b.zip" ARCHIVE from http://adoxa.altervista.org/minitrue/dl.php?f=bin REM - EXTRACT the "mtrw.exe" file in the LOCATION of this BATCH file REM ------------------------------------------------------------------------ REM Copy the "session.xml" file as "New.txt", WITHOUT any CONFIRMATION message copy /y session.xml New.txt > NUL REM ----------------------------------------------------------------------------------------------------------------------- REM Replace, in the "New.txt" file, the DRIVE letter and the COLON of each ABSOLUTE PATH in ALL "file..." tags with REM the CURRENT DRIVE letter and the COLON ( So, the TWO FIRST characters of the INTERNAL ENVIRONMENT variable %CD% ) REM REM (-x) Search REGEX mode by DEFAULT REM -qn QUIET mode and NO prompting REM -c- SENSIBLE to CASE REM -b- NO BACKUP file REM REM Type "mtrw" and ENTER for a QUICK summary REM Type "mtrw -?" and ENTER to open the HELP file REM Type "mtrw -?:Option and ENTER for HELP on a specific OPTION REM ----------------------------------------------------------------------------------------------------------------------- mtrw.exe -qn -c- -b- New.txt [A-Z]: = %CD:~0,2% REM STARTS Notepad++ and opens ALL the files contained in "New.txt", ONLY ! notepad++ -nosession -openSession New.txtBest Regards,
guy038