npocmaka/batch.scripts

in system\monitorInfo.bat file opener is missing

miermontoto opened this issue · 1 comments

In between endlocal and del ~.txt /q /f >nul 2>nul, ~.txt is missing. On its current state, the file won't open any file. Also, adding if EXIST in the first deletion command would make everything cleaner.

Final state of the file:

@echo off
if EXIST ~.txt del ~.txt /q /f >nul 2>nul
start "" /w dxdiag /t ~
setlocal enableDelayedExpansion
set currmon=1
for /f "tokens=2 delims=:" %%a in ('find "Current Mode:" ~.txt') do (
echo Monitor !currmon! : %%a
set /a currmon=currmon+1

)
endlocal
~.txt
del ~.txt /q /f >nul 2>nul

I would have opened a pull request but I have no idea on how to do it.

The idea is the result to be printed in the console. In the ~.txt there's a lot of information that probably you'll never need. Though if you prefer to see the file itself for sure you can use the modified version.