Im trying to execute part of a batch file only if a specific partition is at least a certain size. I found an example of diskpart being used in a batch file here: https://stackoverflow.com/questions/18477576/get-the-amount-of-partitions-on-a-disk-0-using-batch-file
But when I try to modify it to get what I need out of it It stops working entirely. I've scaled back to just this:
@ECHO OFF ECHO select disk 0 > temp.scr ECHO list partition >> temp.scr diskpart /s temp.scr | findstr /r "Partition.[0-9]" > temp.txt pause
based on how I THOUGHT the original worked, shouldn't this be outputting the string found with a regex to temp.txt? temp.exe is empty no matter what I try.
For what it's worth, the end goal is to have a batch file loaded into a winPE image, which is then run automatically with startnet.cmd. This batch file would look at each partition on the disk, find the relevant one (so larger than ~200 gb in this case) and then format that partition, then run some more batch files which I already have made and working.