这个方法一样在非PE下实现功能
解开winpe.is_,得到winpe.iso,然后提取setupreg.hiv,
用注册表编辑器加载到HKEY_LOCAL_MACHINE下,取名为!system,然后导入下面这个reg
  1. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\!system] [HKEY_LOCAL_MACHINE\!system\ControlSet001] [HKEY_LOCAL_MACHINE\!system\ControlSet001\Enum] [HKEY_LOCAL_MACHINE\!system\ControlSet001\Enum\Root] [HKEY_LOCAL_MACHINE\!system\ControlSet001\Enum\Root\UNKNOWN] [HKEY_LOCAL_MACHINE\!system\ControlSet001\Enum\Root\UNKNOWN\9999] 
  2. "ClassGUID"="{FFA1C341-4539-11D3-B88D-00C04FAD5172}" 
  3. "Class"="RamDisk" 
  4. "ConfigFlags"=dword:00000004 
  5. "Mfg"="Nu2 Productions" 
  6. "HardwareID"=hex(7):72,00,61,00,6d,00,64,00,72,00,69,00,76,00,00,00,00,00 
  7. "Service"="Ramdriv" 
  8. "DeviceDesc"="Ramdisk" 
  9. "Capabilities"=dword:00000000 
  10. "Driver"="{FFA1C341-4539-11D3-B88D-00C04FAD5172}\\0001" [HKEY_LOCAL_MACHINE\!system\ControlSet001\Enum\Root\UNKNOWN\9999\Control] 
  11. "DisableCount"=dword:00000000 
  12. "ActiveService"="Ramdriv" 
  13. "FilteredConfigVector"=hex(7):30,00,30,00,00,00,30,00,30,00,00,00,30,00,30,00,\ 
  14. 00,00,30,00,30,00,00,00,30,00,30,00,00,00,30,00,30,00,00,00,30,00,30,00,00,\ 
  15. 00,30,00,30,00,00,00,30,00,30,00,00,00,30,00,30,00,00,00,30,00,30,00,00,00,\ 
  16. 30,00,30,00,00,00,00,00 [HKEY_LOCAL_MACHINE\!system\ControlSet001\Services] [HKEY_LOCAL_MACHINE\!system\ControlSet001\Services\Ramdriv] 
  17. "Type"=dword:00000001 
  18. "Start"=dword:00000003 
  19. "ErrorControl"=dword:00000001 
  20. "DisplayName"="Ramdisk" 
  21. "ImagePath"="system32\\drivers\\ramdriv.sys" [HKEY_LOCAL_MACHINE\!system\ControlSet001\Services\Ramdriv\Enum] 
  22. "0"="Root\\UNKNOWN\\9999" 
  23. "Count"=dword:00000001 
  24. "NextInstance"=dword:00000001 [HKEY_LOCAL_MACHINE\!system\ControlSet001\Services\Ramdriv\Parameters] 
  25. "BreakOnEntry"=dword:00000000 
  26. "DebugLevel"=dword:00000005 
  27. "DebugComp"=dword:ffffffff 
  28. "DiskSize"=dword:00100000 
  29. "DriveLetter"="B:" 
  30. "RootDirEntries"=dword:00000200 
  31. "SectorsPerCluster"=dword:00000002
其中DiskSize是内存盘的大小,DriveLetter是内存盘盘符

DiskSize是内存盘的大小 
32 m          0x02000000 
64 m          0x04000000 
96 m          0x06000000 
128 m        0x08000000


最后把修改好的setupreg.hiv卸载并放回winpe.iso中,system32\drivers还要加入Ramdriv.sys。
另外可以把Ramdriv.sys 改名,并修改相关的注册表就可再建其它Ramdisk盘.