Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Delete Debugging CommentsContent of Delete Debugging Comments.vbsMD5 Hash: 3ECE3A66FE2A18CCB012F582E7857CB4 |
||
' Description: Demonstrates the use of the FileSystemObject as a way to remove debugging comments from a script. Requires comments to have been marked as '* BUG.
Const ForReading = 1 Const ForWriting = 2 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile("C:\Scripts\CreateUser.vbs", ForReading) Do While objTextFile.AtEndOfStream <> true strNextLine = objTextFile.Readline intCheckForBugComment = Instr(strNextLine, "'* BUG") If intCheckForBugComment = 0 Then strSavedLines = strSavedLines & strNextLine & VbCrLf End If Loop Set objTextFile = objFSO.OpenTextFile _ ("c:\scripts\CreateUser.vbs ", ForWriting) objTextFile.Write strSavedLines objTextFile.Close | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |