You seem to be adding the RAM disk with ramdisk.exe (GUI version) but deleting it with ramdiskc.exe (console version), and that's not a correct way to do it.
If you simply need to create a disk, use it, and then delete it, please use ramdiskc.exe for every step. It's a console interface without user prompts designed to be used in scripts and automation for on-demand disks.
Whereas ramdisk.exe command line parameters exist mainly for the initial configuration; for example if you wanted to add a disk after installing the RAM Disk application. Using these command line switches for creating and deleting RAM disks on demand is not recommend because:
This creates and modifies configuration the GUI uses.
There is a possibility of dialog prompts and user interaction may be needed.
The GUI itself uses system resources without need.
There may be problems with more than one instance overwriting each other's configuration.