Skip navigation

JSI Tip 7865. How can I quickly view the last NTBackup log file?

I have scripted NTBackupLog.bat to allow you to quickly view the last NTBackup log file.

The syntax for using is NTBackupLog.bat is:

NTBackupLog \[User Profile Path\]

where User Profile Path is an optional parameter that specifies the user profile path of the user who ran the backup. If not specified, the current user profile path (%UserProfile%) is used.

Create a minimized shortcut on your desktop or Start menu to run the batch file.

NTBackupLog.bat contains:

@echo off
setlocal ENABLEDELAYEDEXPANSION
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!"
endlocal
exit /b 0



Hide comments

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.
Publish