I want OSFmount to save the changed content of the RAM drive back to the disk's .img file. How can I do that from a script, w/o the GUI?
Echo off
:: Create RAM disk
osfmount.com -a -t vm -m K: -o format:ntfs:"RAM Volume" -s 1G
:: copy some files:
xcopy %userprofile%\Desktop\*.* K:
:: create .img file and save it to disk:
echo Use the GUI-App to save the RAM disk to %userprofile%\desktop\RAMDISK.img and exit program ...
osfmount.exe
pause
:: dismount / flush
osfmount.com -d -m K:
:: Flushing file buffers... Where to?
:: re-mount
osfmount.com -a -m K: -f %userprofile%\desktop\RAMDISK.img -t vm -o rw
:: make changes, delete files:
del K:*.* /F /Q
:: verify:
Dir K:
:: dismount / flush. IMHO THIS SHOULD FLUSH CHANGES TO .IMG ON DISK
osfmount.com -d -m K:
:: re-mount
osfmount.com -a -m K: -f %userprofile%\desktop\RAMDISK.img -t vm -o rw
:: verify. ALL FILES STILL THERE
Dir K:
:: Clean up
osfmount.com -d -m K:
del %userprofile%\Desktop\RAMDISK.img
echo on
Echo off
:: Create RAM disk
osfmount.com -a -t vm -m K: -o format:ntfs:"RAM Volume" -s 1G
:: copy some files:
xcopy %userprofile%\Desktop\*.* K:
:: create .img file and save it to disk:
echo Use the GUI-App to save the RAM disk to %userprofile%\desktop\RAMDISK.img and exit program ...
osfmount.exe
pause
:: dismount / flush
osfmount.com -d -m K:
:: Flushing file buffers... Where to?
:: re-mount
osfmount.com -a -m K: -f %userprofile%\desktop\RAMDISK.img -t vm -o rw
:: make changes, delete files:
del K:*.* /F /Q
:: verify:
Dir K:
:: dismount / flush. IMHO THIS SHOULD FLUSH CHANGES TO .IMG ON DISK
osfmount.com -d -m K:
:: re-mount
osfmount.com -a -m K: -f %userprofile%\desktop\RAMDISK.img -t vm -o rw
:: verify. ALL FILES STILL THERE
Dir K:
:: Clean up
osfmount.com -d -m K:
del %userprofile%\Desktop\RAMDISK.img
echo on
Comment