/build/static/layout/Breadcrumb_cap_w.png

Moving the Pagefile.sys to D:

Hi,

Just got tasked to create a MSI that changes the location of the Swap/Page file from C: to D: to free up disk space. I created the MSI to make the needed changes in; (in case your interested)

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management] "PagingFiles"= D:\Pagefile.sys 2046 4092
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Session Manager\Memory Management] "PagingFiles"= D:\Pagefile.sys 2046 4092
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management] "PagingFiles"= D:\Pagefile.sys 2046 4092

After the reboot the new pagefile.sys is created on the root of D: but my problem is that the old pagesfile.sys remains on the C: drive taking up space. What are some ways to remove the old unneeded pagefile.sys.

Even thou it’s still a system file that remains hidden, a right mouse click and the file deletes no problem. How could a initiate a “attrib –s –h pagefile.sys command and a delete after a reboot?

Thanks!

0 Comments   [ + ] Show comments

Answers (9)

Posted by: AngelD 17 years ago
Red Belt
0
Have you tried using the PendingFileRenameOperations to remove the file during reboot (startup)?

http://www.jsifaq.com/SF/Tips/Tip.aspx?id=0578
From the above link: to remove the file just leave "Line 2" blank.
Posted by: JdotQ 17 years ago
Senior Purple Belt
0
(just throwing this out there)

You could create a CustomAction which deletes the file via a VBScript and place it in the sequence after ScheduleReboot?

This might be a sloppy way to do it, but I think it will accomplish the goal...

(maybe some of the veterans around the forum can correct me if I'm wrong?)
Posted by: jmcfadyen 17 years ago
5th Degree Black Belt
0
there is a script on XP machines from MS which relocates and resizes pagefile settings.

i think from memory its called pagefile.vbs just search your sys32 folder.
Posted by: jmcfadyen 17 years ago
5th Degree Black Belt
0
pagefileconfig.vbs
Posted by: Trooper23 17 years ago
Orange Belt
0
Hi AngelD,

Clearing the PendingFileRenameOperations property didn’t delete the file. I must have not done it right but thank you!
Posted by: Trooper23 17 years ago
Orange Belt
0
Hey JdotQ,

I created a AutoIt EXE that did the attrib and delete command, thanks for the idea. I added a RunOnce registry entry that did the job. Thanks a million!
Posted by: Trooper23 17 years ago
Orange Belt
0
Hi jmcfadyen,

Have you opeded that pagefileconfig.vbs, was hands down the scariest and largest VBS I’ve ever seen, but thanks.
Posted by: jmcfadyen 17 years ago
5th Degree Black Belt
0
lol most of it is rubbish I just rewrote it with my own requirements.
Posted by: JdotQ 17 years ago
Senior Purple Belt
0
ORIGINAL: Trooper23

Hey JdotQ,

I created a AutoIt EXE that did the attrib and delete command, thanks for the idea. I added a RunOnce registry entry that did the job. Thanks a million!

Nice! Glad I could help! [:D]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ