JSI Tip 7786. How do I create a shortcut to open the most recent NTBackup log?

Jerold Schulman

February 29, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like