Batch file does not release after /save:R command

4 posts · Closed

Kingston Guest
17 Feb 2021

Hello.
I have a .bat file that runs daily from Windows 10 Task Scheduler. The script is a very simple backup routine:

CD C:\Program Files\SoftPerfect RAM Disk
ramdisk.exe /save:R

The problem is that the .bat file does not release, and control is never returned to Task Scheduler so that subsequent tasks can be run. The task actually terminates when the timeout duration has elapsed.

On Windows 7, this ran fine except I used the command

ramdiskws.exe /save:R
Ann SoftPerfect
17 Feb 2021

I am not entirely sure why the BAT file does not return, but most likely this happens because Windows 10 has tighter security, and BAT files run by Windows Scheduler don't have access to the desktop where the RAM Disk application is running.

Also, I am curious why you are using a BAT file for backups when RAM Disk offers direct functionality? There is a setting that allows you to back up RAM disk to its image file as often as you like.

Kingston Guest
17 Feb 2021

Thanks. The reason for using a .bat file is that this is part of an overall backup routine that involves files and programs outside of RAM Disk. The built-in image saving functionality could possibly work if there were a way to run it at a specific time of day and not just a time interval.

Ann SoftPerfect
17 Feb 2021

Since the built-in image saving is not suitable for your purposes, I would recommend using a file-level backup program (e.g. an archiver like 7Z) to compress everything on the RAM disk into a single container. The added advantage of this method is that you could have incremental backups, and the files can be extracted from the archive at any time.

This topic is closed. It has had no new posts for over a year, so the software versions it talks about may be out of date. Start a new topic in RAM Disk if you have a similar question.