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

Jerold Schulman

March 23, 2004

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

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