Submitted By: Wayne Van Andel
Reads and prints an NT Backup log.
' *********************************************** ' this part of the script pipelines a Unicode file into a text file. ' the text file overwrites a previous file of the same name w/o prompting. ' *************************************************** Set objshell = wscript.createobject("wscript.shell") Set objexecobject = objshell.exec("cmd /c type C:\NTBack03\backup01.log > C:\NTBack03\backup01.txt") wscript.sleep 5000 ' ***************************************** ' this script reads a backup log file, and then prints it out ' ***************************************************** Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile ("C:\NTBack03\backup01.txt", ForReading) strContents = objTextFile.ReadAll objTextFile.Close Wscript.Echo strContents
' *********************************************** ' this part of the script pipelines a Unicode file into a text file. ' the text file overwrites a previous file of the same name w/o prompting. ' *************************************************** Set objshell = wscript.createobject("wscript.shell") Set objexecobject = objshell.exec("cmd /c type C:\NTBack03\backup01.log > C:\NTBack03\backup01.txt") wscript.sleep 5000 ' ***************************************** ' this script reads a backup log file, and then prints it out ' ***************************************************** Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile ("C:\NTBack03\backup01.txt", ForReading) strContents = objTextFile.ReadAll objTextFile.Close Wscript.Echo strContents