Rico.JohnnY Posted June 6, 2004 Share Posted June 6, 2004 is there a way to change the paging file to another drive during an unattended installation of system?for example...i would like to change it to D:\ ,then resize the initial and maximum to 768 & 1536 respectively...how to implement that? Link to comment Share on other sites More sharing options...
ethux Posted June 6, 2004 Share Posted June 6, 2004 Hiya, if you take a look at[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]You'll see a key "PagingFiles", which I think holds the information for the page file, export it and you should be done. However, I've tried it on a Virtual PC installation, but it's always locked at 191MB, it seems there's some problem with Page Files in a VPC, cause it's still stuck at 191MB even when I install without that specific registry setting. Anyway, mine's set to C:\pagefile.sys, with a fixed size of 768MB.[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]"PagingFiles"=hex(7):43,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,00,69,00,6c,\ 00,65,00,2e,00,73,00,79,00,73,00,20,00,37,00,36,00,38,00,20,00,37,00,36,00,\ 38,00,00,00,00,00 Link to comment Share on other sites More sharing options...
Rico.JohnnY Posted June 6, 2004 Author Share Posted June 6, 2004 ::Made by SibTiger May 22, 2004::-------------@echo offclsecho.echo * CHANGE PAGEFILE SIZE AND/OR LOCATION. *:setdriveSET dr=Echo.SET /P dr=Select drive letter for pagefile. IF NOT '%dr%'=='' SET dr=%dr:~0,1%echo This is a temporary file. Please delete. >%dr%:\~tmp.txtif not exist %dr%:\~tmp.txt ( echo. echo Drive %dr% doesn't exist! Enter a different drive letter. goto setdrive)del %dr%:\~tmp.txt:setsizeecho ========================echo.echo Set pagefile size...SET Choice=Echo.echo 1 - 256MB pagefileecho 2 - 384MB pagefileecho 3 - 512MB pagefileecho 4 - 768MB pagefileecho 5 - 1024MB pagefileecho 6 - 1536MB pagefileSET /P Choice= (1,2,3,4,5,6) IF '%Choice%'=='1' (set csize=256goto editreg)IF '%Choice%'=='2' (set csize=384goto editreg)IF '%Choice%'=='3' (set csize=512goto editreg)IF '%Choice%'=='4' (set csize=768goto editreg)IF '%Choice%'=='5' (set csize=1024goto editreg)IF '%Choice%'=='6' (set csize=1536goto editreg)echo.echo !!!You must press 1,2,3,4,5 or 6. Try again.goto setsize:editregecho.echo.echo PAGEFILE WILL BE SET TO: %dr%:\pagefile.sys SIZE: %csize%MBecho Press any key to continue, or CTRL-C to abortpause >NUL:: ---- REGISTRY CHANGES FOR PAGEFILE SIZE AND LOCATION ----echo Windows Registry Editor Version 5.00> cacheset.regecho.>> cacheset.regecho [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management]>> cacheset.regecho "PagingFiles"="%dr%:\\pagefile.sys %csize% %csize%">> cacheset.regecho.>> cacheset.regecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]>> cacheset.regecho "PagingFiles"="%dr%:\\pagefile.sys %csize% %csize%">> cacheset.regecho.>> cacheset.reg:: ------ ADDS _CLEAN.CMD TO RUNONCE --------echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]>> cacheset.regecho "CLEANUP"="c:\\_clean.cmd">> cacheset.regecho.>> cacheset.regREGEDIT /S cacheset.reg:: --- CREATE _CLEAN.CMD ---::DELETES OLD PAGEFILE AFTER REBOOTif exist c:\_clean.cmd del c:\_clean.cmdecho @echo off> c:\_clean.cmdecho rem Created automatically by cacheset.cmd on %date% at %time%.>> c:\_clean.cmdecho echo Old pagefile being deleted. Please wait...>> c:\_clean.cmdif /I not '%dr%'=='C' ( echo if exist c:\pagefile.sys attrib -s -h c:\pagefile.sys>> c:\_clean.cmd echo if exist c:\pagefile.sys del /f /q c:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='d' ( echo if exist d:\pagefile.sys attrib -s -h d:\pagefile.sys>> c:\_clean.cmd echo if exist d:\pagefile.sys del /f /q d:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='e' ( echo if exist e:\pagefile.sys attrib -s -h e:\pagefile.sys>> c:\_clean.cmd echo if exist e:\pagefile.sys del /f /q e:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='f' ( echo if exist f:\pagefile.sys attrib -s -h f:\pagefile.sys>> c:\_clean.cmd echo if exist f:\pagefile.sys del /f /q f:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='g' ( echo if exist g:\pagefile.sys attrib -s -h g:\pagefile.sys>> c:\_clean.cmd echo if exist g:\pagefile.sys del /f /q g:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='h' ( echo if exist h:\pagefile.sys attrib -s -h h:\pagefile.sys>> c:\_clean.cmd echo if exist h:\pagefile.sys del /f /q h:\pagefile.sys>> c:\_clean.cmd)echo del c:\_clean.cmd>> c:\_clean.cmd:: -------------------------echo.echo **** MUST REBOOT FOR SETTINGS TO TAKE EFFECT. ****shutdown.exe -r -f -t 15 -c "Windows XP will now restart in 15 seconds..."echo.echo Automatic restart in 15 seconds. Press any key to abort.pause >NULshutdown -agoto end:endit's a bat file i find in the REG Tweak thread that someone posted.can anyone help to convert it to an auattended mode? for i know little about that..i just want to move the Paging File to D:\ and resize it to 1536M. Link to comment Share on other sites More sharing options...
FuzzBall Posted June 6, 2004 Share Posted June 6, 2004 it's a bat file i find in the REG Tweak thread that someone posted.can anyone help to convert it to an auattended mode? for i know little about that..i just want to move the Paging File to D:\ and resize it to 1536M.This should do it::Made by SibTiger May 22, 2004::-------------@echo offclsecho.echo * CHANGE PAGEFILE SIZE AND/OR LOCATION. *:setdriveSET dr=DEcho.rem SET /P dr=Select drive letter for pagefile. IF NOT '%dr%'=='' SET dr=%dr:~0,1%echo This is a temporary file. Please delete. >%dr%:\~tmp.txtif not exist %dr%:\~tmp.txt ( echo. echo Drive %dr% doesn't exist! Enter a different drive letter. goto setdrive)del %dr%:\~tmp.txt:setsizeecho ========================echo.echo Set pagefile size...SET Choice=6Echo.echo 1 - 256MB pagefileecho 2 - 384MB pagefileecho 3 - 512MB pagefileecho 4 - 768MB pagefileecho 5 - 1024MB pagefileecho 6 - 1536MB pagefilerem SET /P Choice= (1,2,3,4,5,6) IF '%Choice%'=='1' (set csize=256goto editreg)IF '%Choice%'=='2' (set csize=384goto editreg)IF '%Choice%'=='3' (set csize=512goto editreg)IF '%Choice%'=='4' (set csize=768goto editreg)IF '%Choice%'=='5' (set csize=1024goto editreg)IF '%Choice%'=='6' (set csize=1536goto editreg)echo.echo !!!You must press 1,2,3,4,5 or 6. Try again.goto setsize:editregecho.echo.echo PAGEFILE WILL BE SET TO: %dr%:\pagefile.sys SIZE: %csize%MBecho Press any key to continue, or CTRL-C to abortrem pause >NUL:: ---- REGISTRY CHANGES FOR PAGEFILE SIZE AND LOCATION ----echo Windows Registry Editor Version 5.00> cacheset.regecho.>> cacheset.regecho [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management]>> cacheset.regecho "PagingFiles"="%dr%:\\pagefile.sys %csize% %csize%">> cacheset.regecho.>> cacheset.regecho [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]>> cacheset.regecho "PagingFiles"="%dr%:\\pagefile.sys %csize% %csize%">> cacheset.regecho.>> cacheset.reg:: ------ ADDS _CLEAN.CMD TO RUNONCE --------echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]>> cacheset.regecho "CLEANUP"="c:\\_clean.cmd">> cacheset.regecho.>> cacheset.regREGEDIT /S cacheset.reg:: --- CREATE _CLEAN.CMD ---::DELETES OLD PAGEFILE AFTER REBOOTif exist c:\_clean.cmd del c:\_clean.cmdecho @echo off> c:\_clean.cmdecho rem Created automatically by cacheset.cmd on %date% at %time%.>> c:\_clean.cmdecho echo Old pagefile being deleted. Please wait...>> c:\_clean.cmdif /I not '%dr%'=='C' ( echo if exist c:\pagefile.sys attrib -s -h c:\pagefile.sys>> c:\_clean.cmd echo if exist c:\pagefile.sys del /f /q c:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='d' ( echo if exist d:\pagefile.sys attrib -s -h d:\pagefile.sys>> c:\_clean.cmd echo if exist d:\pagefile.sys del /f /q d:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='e' ( echo if exist e:\pagefile.sys attrib -s -h e:\pagefile.sys>> c:\_clean.cmd echo if exist e:\pagefile.sys del /f /q e:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='f' ( echo if exist f:\pagefile.sys attrib -s -h f:\pagefile.sys>> c:\_clean.cmd echo if exist f:\pagefile.sys del /f /q f:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='g' ( echo if exist g:\pagefile.sys attrib -s -h g:\pagefile.sys>> c:\_clean.cmd echo if exist g:\pagefile.sys del /f /q g:\pagefile.sys>> c:\_clean.cmd)if /I not '%dr%'=='h' ( echo if exist h:\pagefile.sys attrib -s -h h:\pagefile.sys>> c:\_clean.cmd echo if exist h:\pagefile.sys del /f /q h:\pagefile.sys>> c:\_clean.cmd)echo del c:\_clean.cmd>> c:\_clean.cmd:: -------------------------echo.echo **** MUST REBOOT FOR SETTINGS TO TAKE EFFECT. ****shutdown.exe -r -f -t 15 -c "Windows XP will now restart in 15 seconds..."echo.echo Automatic restart in 15 seconds. Press any key to abort.:: Remove the 2 lines below if you want the BAT to exit automatically, then windows restartspause >NULshutdown -agoto end:end Link to comment Share on other sites More sharing options...
WwTIPPYwW Posted June 6, 2004 Share Posted June 6, 2004 as stated earlier - [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]"PagingFiles"=hex(7):53,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,00,69,00,6c,\ 00,65,00,2e,00,73,00,79,00,73,00,20,00,32,00,30,00,30,00,30,00,20,00,32,00,\ 30,00,30,00,30,00,00,00,00,00 is the setting, however it is in HEX.when you look at it in the registry it looks like this:S:\pagefile.sys 2000 2000 my pagefile is on the S drive and it is min 2000 and max 2000So, set how you want it, export it out and then you can import it into your unattended without setting up a batch file! Link to comment Share on other sites More sharing options...
prathapml Posted June 6, 2004 Share Posted June 6, 2004 If you are going to use this on WinXP Pro, this is what you need to do:1. go here : prathapml's tweaks2. scroll down to tweak #17 (Pre-configure/automate your swap file)3. Implement what is written there.The method described in the site mentioned above is far simpler than any mentioned here, and is portable everywhere. Link to comment Share on other sites More sharing options...
Rico.JohnnY Posted June 6, 2004 Author Share Posted June 6, 2004 Thx all you guys...you are so helpful Link to comment Share on other sites More sharing options...
MCT Posted June 6, 2004 Share Posted June 6, 2004 If you are going to use this on WinXP Pro, this is what you need to do:1. go here : prathapml's tweaks2. scroll down to tweak #17 (Pre-configure/automate your swap file)3. Implement what is written there.nice job ill get some use outta that thanks 4 postin it Link to comment Share on other sites More sharing options...
ethux Posted June 6, 2004 Share Posted June 6, 2004 WwTIPPYwW: Yep, that's what I did. However, the pagefile is always stuck at 191MB on my virtual PC. Does it work for you?prathapml: Thanks I'll check that out .Edit: prathapml, yours seems very effective . I'm trying it on my VPC in an hour or so .Edit: Bah, it's still stuck at 191MB. The initial size shows 768MB, and the maximum size shows 768MB. However, the "Currently Allocated" shows 191MB. Restarting it didn't work. Is this a VPC 2004 bug? Link to comment Share on other sites More sharing options...
prathapml Posted June 9, 2004 Share Posted June 9, 2004 After setting your swap-file, you need to re-start. But since you say you have done that as well, I'd look for other reasons:Does your Virtual machine have enough free Hard-disk space?Did you install the VPC tools for the guest OS?Is your VM hosted on a FAT32 partition on your host? (instead of NTFS as it should be)If none of these reasons are true, then just dump VPC2004 - it just has too many bugs. VMware is 7x faster. As for the swap-space tweak I posted, it has worked invariably in all _real_ machines and in VMware - only VPC seems to have a problem (the problem you reported is the first time my tweak does not seem to work). Link to comment Share on other sites More sharing options...
ethux Posted June 9, 2004 Share Posted June 9, 2004 Yup my virtual hard disk has 3GB, and it's NTFS . Alright I'll give VMWare a try. Thanks man . Link to comment Share on other sites More sharing options...
ethux Posted June 10, 2004 Share Posted June 10, 2004 Hiya, I've tried VMWare. My page file is stuck at 383MB now =\. the attached screenshot will give a better idea of my problem. Thanks in advance. Notice the pagefile is set at 768-768MB, but the allocated is 383MB . I've restarted many times already. Link to comment Share on other sites More sharing options...
Guest zippy Posted June 10, 2004 Share Posted June 10, 2004 check this article out...Virtual Memory in Windows XPand this article... The Memory-Optimization Hoax Link to comment Share on other sites More sharing options...
ethux Posted June 10, 2004 Share Posted June 10, 2004 Hiya, thanks for those links, but they don't state any thing related to my problem, or did I miss it? By the way, interesting articles, especially the 2nd one . Link to comment Share on other sites More sharing options...
prathapml Posted June 11, 2004 Share Posted June 11, 2004 Oh save me lord!hey, ethux:You need to reboot once after setting that swap-file command.(Now I understand, it wasn't "stuck" as you say - it simply needed a restart).YAY! So my tweak does work invariably after all. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now