REM Use "More" to read the file and skip a number of lines in the fileįOR /F "tokens=4 delims= " %%A IN ('more /E +%startLine% temp.txt') DO ( REM Set a counter to get the last 5 Temp Readings and Current One REM Use Set /A to subtract 5 from the line number to get how many lines to skip from the file REM Get the number of lines in the temp.txt fileįOR /F "tokens=3 delims= " %%i IN ('find /v /c "temp" temp.txt') DO set /a lines=%%i If "%temp%" >= 20 or "%temp%" > Update on progress -U -P sensor reading "Ambient Temp" > temp.txt Ĭan someone help me work out how to do this so I can get this part of the text file or IMPI tool output into a local variable ?īased on the output of the reading, I would like different actions to be performed: If "%temp%" >50ĮCHO The AC is Broken - Call an Engineer and power down the server !ĮCHO Turn the AC Up to MAX - its getting toasty in here 22 into a local variable %temp% for example. What I would like to do is read the file string into a local variable in the ms dos.bat file and then based on the value - get the actual reading part of the string e.g. > This gives me an output file which gives the temp ambient (of the motherboard): Ambient Temp | 22 Ipmitool -I lanplus -H -U root -P calvin sensor reading "Ambient Temp" > temp.txt What do I have so far: REM Find out what the Ambient Temp is. I have the IMPITools installed and working on the system (it generates the ambient temp output to a file) and have snipets of code, I'm struggling to put it together to do an action based on the value that comes back. I'm trying to write a Windows batch file script to generate some output actions for a Dell R710 based on Ambient Temps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |