Batch file : Manage Local Hard Disk (RAMDRIVE)

Community Forums/General Help/Batch file : Manage Local Hard Disk (RAMDRIVE)

Imperium(Posted 2013) [#1]
I haven't messed with Batch files in a long time but I need a script that will do the following.

Auto run when Windows starts.
Go into Admin tools.
Computer Management.
Location 1 and Location 0 (these are hardware ramdisks)
Add both devices and format them to ntfs.
Setup one as E:Ramdisk1 and F:Ramdisk 2.

The issue I'm having if after a restart Windows won't see the ramdisk hard drives until they are formatted and mounted. I'd like to eventually get these working with a backup image so I could possibly put the paging file onto one of these. Any ideas on how I can go about this?

http://productivity.ben61a.com/windows/run.php


xlsior(Posted 2013) [#2]
Batch files run their own commmand sets, and wont' interface directly with the windows GUI -- which means that you need command line versions of whatever steps you'd normally do in the disk mananager.

However -- There's a freeware toolkit called AutoIt ( http://www.autoitscript.com/site/autoit/ ) that can automate windows actions through a scripting language that you could conceivable use to go through the chain of events that you want, but personally I'd be EXTREMELY reluctant to attampt to automate your process considering it involves formatting drives -- you're only one plug&play re-enumeration mishaps away from having your actual hard drive show up as device 0 and formatting one of your actual hard drives by accident.


Imperium(Posted 2013) [#3]
I understand the cause for concern. But the RAMDISK card shows up both in the bios and hardware list in windows and unless the hardrive windows is installed on decides to randomly switch its value I don't see how this could even happen. Perhaps I could do a simple check and if the device is over a a certain size (Gigabytes) and if so it will assume it is a hard drive and not the Ramdisk which will void the formatting action. (if I code it correctly!)

For some reason Windows is not remember the device settings after a restart. It's supposed to. After going to Disk Management> Format and Initialize. And give it a drive letter it works fine but this kind of kills my idea of using a portion of it for the system paging.


xlsior(Posted 2013) [#4]
If this RAM drive is indeed a hardware device (plugin card?), then it's possible that it has an on-board battery that may have run out?


Imperium(Posted 2013) [#5]
Yes it does have a battery but took the battery out. I thought the battery was only if you had a total power failure? The device has the capability to backup data inside the memory to a image file, then upon boot it will load the image data back into the ramdisk. But it won't do this if windows won't correctly manage the ramdisk hard drive in the first place.


xlsior(Posted 2013) [#6]
I thought the battery was only if you had a total power failure?


Depends on the device -- some of them actually apply a very low power to the memory chips themselves for them to retain information after a reset/power down