回复 5# hfstar - @echo off
- set drive=C:\
- set /p "drive=请输入盘符[C:\, D:\, E:\, ...]:"
- 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='%drive%pagefile.sys',initialsize=%InitialSize%,maximumsize=%MaximumSize%
- wmic pagefileset where"name='%name:\=\\%'" delete
- set reboot=n
- set /p "reboot=请选择是否重启[y|n]:"
- wmic os where (primary='1') call win32shutdown 6
复制代码
|