Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Is it possible to add or delete pagefile.sys size and partiotion with DOS?  (Read 4672 times)

0 Members and 1 Guest are viewing this topic.

ionic

    Topic Starter


    Rookie

    Here is what I'd like to accomplish. I can do some DOS batch stuff, but other than that I am a brainless ol fart.

    I have two partitions setup with aprox. 4GB each, named PageFile_1 and PageFile-2. I'd like to use only one of them at any
    given time.

    Every couple of weeks, I would like to unallocated from one partition and allocate to the other partition. After this is done I would
    like to securely wipe the recently used partition so that it is ready for the next swap.

    Is this possible via DOS only? I know I can wipe the free space with systernals  "sdelete" via a batch file, just don't know if allocating and unallocating the pagefile.sys from partition to partition is possible.

    Could use some insight with this.

    Thanks

    ionic

      Topic Starter


      Rookie

      Perhaps something like this:

      Code: [Select]
      ===== BATCH SCRIPT BEGIN =====
      @echo off
      goto menu
      :menu
      echo.
      echo What would you like to do?
      echo.
      echo Choice
      echo.
      echo Change Pagefile.sys from Drive E: to Drive G: or visa versa
      echo q Quit

      echo.

      :choice
      set /P C=[e,g,q]?
      if "%C%"=="q" goto quit
      if "%C%"=="g" goto SetG
      if "%C%"=="e" goto SetE
      goto choice


      :SetG
      echo Set Pagefile.sys to Drive G: at 3000, 3000?
      pause
      cls
      regedit.exe /s DriveG_PageFileSize.reg
      pause
      goto menu

      :SetE
      echo Set Pagefile.sys to Drive G: at 3000, 3000?
      pause
      cls
      regedit.exe /s DriveE_PageFileSize.reg
      pause
      goto menu

      :quit
      exit
      :end
      ===== BATCH SCRIPT END =====


      DriveG_PageFileSize.reg
      Code: [Select]
      Windows Registry Editor Version 5.00

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
      "PagingFiles"=hex(7):47,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,33,00,30,00,30,00,30,00,20,00,33,00,\
        30,00,30,00,30,00,00,00,00,00


      DriveE_PageFileSize.reg
      Code: [Select]
      Windows Registry Editor Version 5.00

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
      "PagingFiles"=hex(7):45,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,33,00,30,00,30,00,30,00,20,00,33,00,\
        30,00,30,00,30,00,00,00,00,00

      I would have to reboot before running sdelete.exe to wipe the cleared drive.

      ionic

        Topic Starter


        Rookie

        The next question, one that arises after exporting the .reg key is: why does the following line...

        Code: [Select]
        NAME             TYPE             DATA
        PagingFiles      REG_MULTI_SZ     E:\pagefile.sys 3000 3000


        appear as...

        Code: [Select]
        "PagingFiles"=hex(7):45,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,33,00,30,00,30,00,30,00,20,00,33,00,\
          30,00,30,00,30,00,00,00,00,00

        ...and, is there a way to get the .reg file in the first format, so that it is editable?

        iONik



          Beginner

          I really appreciate all the help and suggestions!!

          What would I do without you guys!