Tech How To
Jump to navigation
Jump to search
Windows
Backup - File History - Restore Points
- Backup
- Windows 7 Backup (appears obsoleted)
- File History
- Windows 10
- "Previous Versions" of files under File/Folder Properties comes from File History or Restore Points
- Restore Points (System Protection for Drives)
- This seems to be the most reliable solution to get Previous Versions working
- Find under Settings > System > About aka System Properties > System Protection (right-hand side) or search "restore point" from Start
- Restore Points are created automatically during system changes, such as new software, drivers, windows updates, etc., or every 7 days for drives with System Protection enabled
- Restore Points can be manually created on demand via the Restore Points settings
- Manual Backups
- ie. FreeFileSync
Run System File Checker and DISM tool in Windows 10
# Run System File Checker tool (SFC) # - Run Command Prompt as Administrator: sfc /scannow # - Afterward, note the output of the SFC tool. You would get the output something like: # - Windows did not find any integrity violations (a good thing): No corruptions found # - Windows Resource Protection found corrupt files and repaired them (a good thing): Corrupt files found but repaired # - Windows Resource Protection found corrupt files but was unable to fix some (or all) of them (not a good thing)-Corrupt files found but not repaired # - For the Corrupt files found but it could not be repaired, you need to run the DISM tool. See below. # Run Deployment Image Servicing and management tool(DISM.exe) # - Run Command Prompt as Administrator: DISM.exe /Online /Cleanup-image /Scanhealth DISM.exe /Online /Cleanup-image /Restorehealth # If DISM tool is unable to repair corrupt files # - If the message after running /RestoreHealth switch throws an error saying “The source files couldn’t be found” then it requires an Installation media to corrupt the files. You should do the following steps if you have one*: Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:sourcesinstall.wim:1 /limitaccess # - It might take hours to finish, depending on the level of corruption. These steps can help you to fix corrupted files using SFC and DISM tool.
Batch Scripting and Command Scripting
Batch (Command.com) vs Command (Cmd.exe):
- https://stackoverflow.com/a/149918/3727869
- command.com is the 16-bit command processor introduced in MS-DOS and was also used in the Win9x series of operating systems.
- cmd.exe is the 32-bit command processor in Windows NT (64-bit Windows OSes also have a 64-bit version).
- cmd.exe is backward compatible with command.com.
- The ComSpec env variable defines which program is launched by .bat and .cmd scripts. (Starting with WinNT this defaults to cmd.exe.)
- cmd.exe was never part of Windows 9x.
- It originated in OS/2 version 1.0, and the OS/2 version of cmd began 16-bit (but was nonetheless a fully fledged protected mode program with commands like start).
- Windows NT inherited cmd from OS/2, but Windows NT's Win32 version started off 32-bit.
- Although OS/2 went 32-bit in 1992, its cmd remained a 16-bit OS/2 1.x program.
- A script that is designed for cmd.exe can be named .cmd to prevent accidental execution on Windows 9x. This filename extension also dates back to OS/2 version 1.0 and 1987.
Here is a list of cmd.exe features that are not supported by command.com:
- Long filenames (exceeding the 8.3 format)
- Command history
- Tab completion
- Escape character: ^ (Use for: \ & | > < ^)
- Directory stack: PUSHD/POPD
- Integer arithmetic: SET /A i+=1
- Search/Replace/Substring: SET %varname:expression%
- Command substitution: FOR /F (existed before, has been enhanced)
- Functions: CALL :label
Order of Execution:
- If both .bat and .cmd versions of a script (test.bat, test.cmd) are in the same folder and you run the script without the extension (test), by default the .bat version of the script will run, even on 64-bit Windows 7.
- The order of execution is controlled by the PATHEXT environment variable.
- See Order in which Command Prompt executes files for more details.
References: