1
The following is my nightly_backup.bat file, scheduled to run every night at 11pm.
But though it does the backups ok, I never find it paused in the morning, like I expect it.
echo off
ROBOCOPY C:\PRIMARY B:\BACKUP\PRIMARY\ /e /NFL /NDL
ROBOCOPY B:\BACKUP\ E:\BACKUP\ /e /NFL /NDL
ROBOCOPY B:\ARCHIVE\ E:\ARCHIVE\ /e /NFL /NDL
rem Backup favorites-
ROBOCOPY C:\Users\douglaskbell\Favorites C:\BACKUP\FAVORITES\ /e /NFL /NDL
ROBOCOPY C:\Users\douglaskbell\Favorites B:\BACKUP\FAVORITES\ /e /NFL /NDL
ROBOCOPY C:\Users\douglaskbell\Favorites E:\BACKUP\FAVORITES\ /e /NFL /NDL
DATE /T
pause
:EXIT
DATE /T
Well the code as it stands should pause. So, the question becomes how have you scheduled it to run? I'm assuming task scheduler, but what exact settings have you used? Do you have it running as the logged on user, as system, with highest priveleges, etc? It likely is pausing, but you are running the script in the background (as SYSTEM or some other user) so you don't see it. If you look in task manager, you'll see a cmd.exe process running but you won't see it. If you were running this as the logged on user, it would probably fail due to UAC. – Appleoddity – 2017-11-20T03:12:58.007
1
pause
is an internal command of cmd.exe, it's not a DOS command. DOS and Windows cmd are not the same thing – phuclv – 2017-11-20T03:54:31.527The "pause" command is inherently interactive. It's not surprising that it is ignored in a non-interactive environment, such as when the user is not logged in. – kreemoweet – 2017-11-20T22:46:29.717