JSI Tip 7786. How do I create a shortcut to open the most recent NTBackup log?
February 29, 2004
The NTBackup.exe program keeps 10 versions of the backup log, named Backup01.log through Backup10.log, in the
Local SettingsApplication DataMicrosoftWindows NTNTBackupdata" folder of the user context that ran the backup. These logs are automatically reused as necessary.
I have scripted NTBackupLog.bat to open the most recent backup log in Notepad.exe.
The syntax for using NTBackupLog.bat is:
NTBackupLog [UserProfilePath]
where UserProfilePath is an optional parameter that specifies the path to the user profile that ran the backup. If omitted, the current user profile path, %USERPROFILE%, is used.
You can create a Minimized shortcut to NTBackupLog.bat [UserProfilePath] and place it on your desktop or Start menu.
NTBackupLog.bat contains:
@echo offsetlocal ENABLEDELAYEDEXPANSIONset file=Nset user=%UserProfile%if {%1} NEQ {} set user=%1set user=%user:"=%set folder=%user%Local SettingsApplication DataMicrosoftWindows NTNTBackupdatafor /f "Tokens=*" %%a in ('dir "%folder%backup*.log" /b /O-D') do if "!file!" EQU "N" set file=%%astart "!file!" "%SystemRoot%otepad.exe" "%folder%!file!"endlocalexit /b 0
About the Author
You May Also Like