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

The NTBackup.exe program keeps 10 versions of the backup log, named Backup01.log through Backup10.log, in the
\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data" 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 off
set file=N
set user=%UserProfile%
if \{%1\} NEQ \{\} set user=%1
set user=%user:"=%
set folder=%user%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
for /f "Tokens=*" %%a in ('dir "%folder%\backup*.log" /b /O-D') do if "!file!" EQU "N" set file=%%a
start "!file!" "%SystemRoot%\notepad.exe" "%folder%\!file!"
exit /b 0

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.