Move pagefile.sys from C: to D:

Posted on 2005-04-08
Last Modified: 2010-08-05
I have a Dell windows 2000 server with a 4gb C: partition and I need the hard drive space so I moved the pagefile.sys to the D: partition and reboot the server.  When I try to delete the 1.5gb pagefile.sys from the C: partition i get the error message that says:

Cannot delete the Pagefile: There has been a sharing violation
The source or destination file may be in use
Question by:cgriffith4
    LVL 1

    Expert Comment

    LVL 7

    Expert Comment

    You must be sure:
    a) Pagefile was moved to d (ie, "deleted" from c)
    b) Restart after moving, to unock the file
    e) Try again
    LVL 15

    Accepted Solution

    You need to let Windows define a new location for the paging file, which is where it stores its virtual memory.

    In Windows 2000, right-click on My Computer and choose Properties, then the Advanced tab, then the Settings button in the Performance section, then the Advanced tab (of the Performance Options window), then the Change button in the Virtual Memory section.

    Select your D drive, then the "System managed size" radio button (or the custom size, if you want to manually define the size), and click the Set button. That tells Windows to use D for paging. Then select your C drive, click the "No paging file" radio button, then the Set button again. That tells Windows to stop using C for paging. Finally, click the OK button to save your changes, and reboot for them to take effect. After that, you can delete the pagefile.sys from the C drive. (If you put it in the Recycle bin, remember it won't free the hard drive space until you empty the Recycle bin.)

    LVL 24

    Expert Comment

    Funny database question ;)

    jdlambert1 is correct however - you should only move the pagefile via Windows, and it will involve a restart.  If you delete the pagefile from DOS (for example), Windows will simply recreate it next time it starts.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Query performance SQL Server 15 64
    Changing the order of columns 9 58
    VFP9 options in the cloud (and elsewhere) 3 102
    sql query help 7 73
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now