Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two operating systems installed (windows 8 & mint) and I am trying to shrink the original windows partition, but there is the swapfile.sys permanent file in the way. So I was wondering, is it possible to log into the Linux side, then access the swapfile.sys and move it when it is not open?

share|improve this question

You can moveswapfile.sys by disabling paging file and then creating a symbolic link at C:\swapfile.sys (assuming C: is your system drive). Whole procedure can be performed in Windows environment.

The following steps will disable swapfile.sys (tested on Windows 8 and Windows 8.1 Preview):

  1. Disable page files on all drives (through Control Panel -> System and Security -> System -> Advanced system setting -> Advanced -> Performance Options -> Advanced -> Virtual memory).
  2. Restart your computer.
  3. swapfile.sys should be gone now. If it's still present, it may be deleted manually.

Afterwards enter following command in command line (requires administrative privileges):

mklink C:\swapfile.sys "<NEW LOCATION>:\swapfile.sys"

If new location path doesn't contain spaces, quotes can be omitted. Note that in Windows PowerShell (which is promoted in Windows 8.1) mklink command is not accessible. You should call regular command line by typing cmd and then proceed in the same window.

After that you can enable pagefile and newly created swapfile.sys will be located wherever the symbolic link points to. The symbolic link itself occupies minimal possible disk space.

share|improve this answer

This is the new pagefile for "Windows Store Apps". I've searched for a way to move it for, but never found a way. You can only stop the creation if you disable the pagefile completely.

share|improve this answer
The pagefile has been completely removed and is not imposing on my drive. I am logged in on Linux now, and perusing the Windows partition. If I move/delete the file from this side, will it break Windows? – topherg Jan 23 '13 at 11:32
When turning off the pagefile and do a reboot, the file should be gone. So I have no idea why you still see it from Linux. – magicandre1981 Jan 23 '13 at 19:44
So its a cache which is supposed to be deleted. So I can delete it, and when I go into Windows, will it mind that the file is missing, and if it creates a new file, will it be in the same location? – topherg Jan 23 '13 at 23:22
I have no idea if it will be created again. I think so, because the normal pagefile.sys is created again. – magicandre1981 Jan 24 '13 at 4:49
ah cool, i'll have a go later, and i'll let you know if its ok or not incase anyone else has a similar issue – topherg Jan 24 '13 at 10:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .