Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion refine.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
@echo off
setlocal EnableDelayedExpansion

if "%PSModulePath%"=="" (
SET PS=false
) else (
SET PS=true
)

rem Change current working directory to directory of the batch script
cd %~dp0

Expand Down Expand Up @@ -193,7 +199,13 @@ if ""%ACTION%"" == """" goto doRun

:doRun

for /f "tokens=2 delims==" %%i in ('wmic OS get FreePhysicalMemory /Value') do set /a freeRam=%%i/1024
@echo off
if "!PS!"=="true" (
for /f %%i in ('powershell -Command "(Get-CimInstance Win32_OperatingSystem).FreePhysicalMemory"') do set /a freeRam=%%i/1024
) else (
for /f "tokens=2 delims==" %%i in ('wmic OS get FreePhysicalMemory /Value') do set /a freeRam=%%i/1024
)

echo -------------------------------------------------------------------------------------------------
echo You have %freeRam%M of free memory.
echo Your current configuration is set to use %REFINE_MEMORY% of memory.
Expand Down