PDA

View Full Version : OSFMount CLI - Auto mount RAM drive on boot



darkknight
02-23-2012, 07:47 PM
First, I'd like to express my sincere gratitude for making OSFMount (http://www.osforensics.com/tools/mount-disk-images.html) available for free.

Often I end up mounting a ram drive, and I'd like to speed up the process of doing so. I decided to try creating a batch script using your CLI to get the process going, but I'm having an issue where OSFMount is "Notifying applications...". I have a FORMAT statement just after the osfmount command, but a soon get a pop-up asking me to format the RD anyway. I don't know if this is a result of the notifying part, or because Windows is detecting a new disk. I would like the process to be essentially silent. Guidance would be appreciated.


Thanks.

Edit: Answered my own question. I had been using an IF EXIST statement that didn't work because unformatted volumes cannot be found with it. After that, I had too much of a delay, and the Start /wait didn't function as intended. If you mount a RD, then format it quickly enough, the pop-up never comes up.

e.g.:

osfmount -a -t vm -m z: -s ****M
ECHO y|FORMAT Z: /FS:NTFS /Q

This silently produces a RD of specified size, with no pop-ups on my W7-x64 system. The only danger would be that format has no way of knowing if it is formatting the correct volume. OSFM could fail because volume z: already exists, and this would format it anyway. Careful use, or some sort of safety should be put in.

David (PassMark)
02-23-2012, 08:18 PM
Glad you sorted it out. This might help a few other people as well.

darkknight
12-22-2012, 02:17 AM
Humorously enough, I just googled how to do this for another machine and the first result was my own post explaining it. Awesome.