Command in .bat file does not return

Started by Kingston

Kingston

Command in .bat file does not return   17 February 2021, 13:05

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
SoftPerfect Support forum - Ann avatar image
Ann

Re: Command in .bat file does not return   17 February 2021, 13:09

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

Re: Command in .bat file does not return   17 February 2021, 13:13

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.
SoftPerfect Support forum - Ann avatar image
Ann

Re: Command in .bat file does not return   17 February 2021, 13:15

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.

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **     **   *******   **     **  **     **        ** 
  **   **   **     **  **     **  ***   ***        ** 
   ** **           **  **     **  **** ****        ** 
    ***      *******   **     **  ** *** **        ** 
   ** **           **   **   **   **     **  **    ** 
  **   **   **     **    ** **    **     **  **    ** 
 **     **   *******      ***     **     **   ******  

Message: