Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at: https://www.gnu.org/copyleft/fdl.html.
2 Install Startup
2.1 Required Resources
2.2 Operation
2.3 Installation
This document describes useful utilities that were used in developing Nuances In Computing (NIC).
This is a command file (InstallStartup.bat) that installs a simple backup system. The backup system runs when a Windows PC is started and it copies specified directories to a backup disk. It maintains separate archives for each day of the week and for each month. It is useful as a quick recovery system. It is not a substitute for an off-site backup. A review of off-site back systems may be found at https://www.pcmag.com/article2/0,2817,2288745,00.asp.
A separate drive is required. Either a dedicated internal drive or an external drive. A typical example is a 2 TB USB Drive.
Windows has two folders that are used to automate processes on a Windows PC.
The first is "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup". It may be reached by entering:
<Windows-Key><R>shell:startup<Enter>
Commands located in this folder are executed when the owner of the account logs in.
The Second is "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup". It may be reached by entering:
<Windows-Key><R>"shell:common startup"<Enter>
Commands located in this folder are executed when any user logs in.
InstallStartup.bat installs command file Begin.bat in the first folder ("shell:startup") and also installs a second command file "%USERPROFILE%\Startup\Startup.bat". Begin.bat starts Startup.bat every time the user logs in. Startup.bat is used to automate processes, such as a simple backup.
Notes:
Since, for this implementation, only a single process is implemented, the entire process is contained in Startup.bat. If multiple processes are required, copy Startup.bat to, say, Another-proc.bat and use a new Startup.bat that invokes processes as appropriate.
Remember that in Windows 10, an exit command stops all processes in the chain, so avoid the use of exit, except at the end of Startup.bat.
Also it is wise to invoke the command processor (cmd.exe) with the single instance flag (/C) so that if the command fails (or ends with exit), the rest of Startup.bat keeps executing. For example, cmd/C Another-proc.bat, invokes Another-proc.bat with the single instance flag.
Near the end of Startup.bat is a check for Startup2.bat. If Startup2.bat exists it is invoked using:
cmd/c Startup2.bat.
To install the backup system, double-click InstallStartup.bat. It will create the necessary commands and directory structure. It is necessary to edit Startup.bat (in "%USERPROFILE%Startup") to establish the command file defaults. The default is to do nothing. The following changes are recommended:
Near line 26 is "goto Quit". Comment this line as in "rem goto Quit". This allows the backup system to execute.
Change line 18 to point to your backup disk. The default is "G"
Line 20 contains "Zip=Yes". This specifies to use 7-Zip to perform monthly archives. Set it to Zip=No to disable 7-Zip archiving.
Line 22 contains "RC=No". This specifies to not use RoboCopy to perform monthly archives.
Having both Zip=No and RC=No disables monthly archives. Setting both to Yes gives two archives, one for RoboCopy and one for 7-Zip.
7-Zip may be installed from: http://www.7-zip.org/download.html.