Carrying on from the recent thread about the worldwide computer outage and the mention of backing up. here is a quick and easy way to back up all your files onto a USB thumb drive or hard disk.
It makes certain assumptions:
That you use C: drive for your files.
That you use the M$ default directories to store your files (all is not lost if you don’t)
That you know how to copy and paste
That you know how to change a file extension.
The following code needs to be copied into a text editor like Notepad then it needs to be saved onto a thumb drive or HDD as, say, “Backup.bat” note the extension (last three characters) is not .txt (the default). As a safety measure it will not run on C drive
As it stands double clicking on it should run BUT it will show you what it will do without actually doing anything (except create a Backup Text date file). To make it work load it into Notepad by right clicking and cursor down to “Edit in Notepad” and only remove * “/L”* from the end of the line which starts with “Robocopy”. Another safety measure.
The file will make no changes to your computer so at worst you will mess up a thumb drive.
OK the code:
@echo off
set "TargetDrive=%~d0"
REM Check it is not C: Drive
if %TargetDrive%==C: (
echo.
echo DO NOT RUN THIS ON C: DRIVE
echo.
pause
goto :eof
)
setlocal enabledelayedexpansion
echo.
echo Backing up Important Files to Thumb Drive...
echo.
for %%f in (Documents, Pictures, Videos) do (
Robocopy "%userprofile%\%%f" "%TargetDrive%\%computername%\%username%\%%f" /r:1 /w:3 /s /xo /L
)
rem Date stamp latest back up
echo.
echo Backed up on %date% at %time% > "%TargetDrive%\Backup Date.txt"
echo.
echo That's the lot...
echo Thank you and Goodnight!
echo.
Pause
endlocal
Make sure you copy it all, it starts with @echo off and ends with endlocal.
To run it just double click if you are using an administrator’s account otherwise right click and select “Run as Administrator”. Once you have removed the “/L” backups are just a double click away, no more is needed
Works on any Windows computer for any account.
Will write another post later if there is a need on how to make it find your directories if you don’t use Windows created ones
Any questions?