本帖最后由 terse 于 2012-3-5 07:59 编辑
- @echo off
- SET P=D:\
- for /f "tokens=2 delims==" %%i in ('"wmic memlogical get totalphysicalmemory /value 2>nul"') do set/a InitialSize=%%i*3/2048,MaximumSize=%%i/512
- for /f "tokens=1,2 delims==" %%i in ('"wmic pagefileset get Name /value 2>nul"') do FOR %%J IN (%%i) DO set "%%i=%%j"
- wmic os where (primary='1') call win32shutdown 6
- wmic pagefileset create name='%P%pagefile.sys',initialsize=%InitialSize%,maximumsize=%MaximumSize%
- wmic pagefileset where"name='%name:\=\\%'" delete
- wmic os where (primary='1') call win32shutdown 6
- pause
复制代码
|