Log\_RemoveLogs
VB Scripting Library > OSD Scripting Library > Log functions (OSD)
Log_RemoveLogs()
Section titled “Log_RemoveLogs()”Removes all existing log files from the folder with the same name as the computers UUID.
Arguments
Section titled “Arguments”No arguments provided.
Return Type
Section titled “Return Type”Boolean, TRUE if function completed successfully.
Remarks
Section titled “Remarks”Typpically used in the PreBootScript.wsf
Example
Section titled “Example”The following example will do the following:
-
Set the global variable gsLogServerFolder to a log share on the OSD server.
-
Add a custom logfile is registered for submit along with the well-known logfiles.
-
Register the product key as an unwanted text string that should be excluded from all files.
-
Submit the logfiles.
Private Function IncludeScript(sScriptFile)'...End Function'BeginbStatus=TrueIf bStatus Then bStatus=IncludeScript("customlib.cis")If bStatus Then bStatus=IncludeLibrary("Capalib.cin")If bStatus Then bStatus=IncludeLibrary("Osdlib.cin")If bStatus Then bStatus=Job_Start("WS","Script Name","1.0","ScriptName.log","INSTALL")If bStatus Then bStatus=OSD_Initialize()gsLogServerFolder="\\" & gsBootServer & "\LogFiles" 'set the log folder rootsProductKey = "11111-22222-33333-44444-55555"If bStatus Then bStatus=Sysprep_SetProductKey(sProductKey)If bStatus Then bStatus=Log_RemoveLogs() 'remove any existing logfilesIf bStatus Then bStatus=Log_RegisterExcludeValue("Product key",sProductKey) 'remove productkey value from logfilesIf bStatus Then bStatus=Log_RegisterWellKnownFiles()If bStatus Then bStatus=Log_RegisterLogfile("X:\MyTestLog.log") 'register an aditional file to submitIf bStatus Then bStatus=Log_SubmitLogs() 'submit the logsJob_End(bStatus)'End main
See Also
Section titled “See Also”Scripting Guidelines, Log_RegisterExcludeValue, Log_RegisterWellKnownFiles, Log_RegisterLogfile, Log_SubmitLogs