Add dry run mode and auto root path via %~dp0
This commit is contained in:
@@ -42,12 +42,32 @@ ROOT\
|
||||
|
||||
### Setup
|
||||
|
||||
1. Open `Rename and Move PT STMT.bat` in Notepad
|
||||
2. Set the `ROOT` variable to your actual folder path:
|
||||
```bat
|
||||
set "ROOT=C:\Users\Melissa\Documents\Patients"
|
||||
```
|
||||
3. Save and double-click to run
|
||||
1. Place `Rename and Move PT STMT.bat` in the root patient folder
|
||||
2. Double-click to run — it automatically uses the folder it lives in as the root
|
||||
|
||||
### Dry Run
|
||||
|
||||
The script defaults to **dry run mode** — it will print every action it would take without touching any files. To run for real, open the file in Notepad and change:
|
||||
|
||||
```bat
|
||||
set "DRYRUN=1"
|
||||
```
|
||||
to:
|
||||
```bat
|
||||
set "DRYRUN=0"
|
||||
```
|
||||
|
||||
Dry run output looks like:
|
||||
```
|
||||
[DRY RUN] No files will be changed.
|
||||
|
||||
Found: C:\Patients\abc\Patient\Export\.
|
||||
RENAME export.txt > PT STMT_20260423.txt
|
||||
MKDIR PT STMT_20260423
|
||||
MOVE PT STMT_20260423.txt > PT STMT_20260423\
|
||||
MOVE 1000001.tif > PT STMT_20260423\
|
||||
MOVE 1000002.tif > PT STMT_20260423\
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user