Guest User

Notesini

a guest
Jan 4th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Set objFSO = CreateObject("Scripting.FileSystemObject")
  2.  
  3. If objFSO.FileExists("C:\Program Files (x86)\IBM\Lotus\Notes\notes.ini") Then
  4.  
  5. Const ForReading = 1
  6. Const ForWriting = 2
  7.  
  8. Set objFSO = CreateObject("Scripting.FileSystemObject")
  9. Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\IBM\Lotus\Notes\notes.ini", ForReading) ' Read the file for "InstallType =2"
  10.  
  11. strText = objFile.ReadAll
  12. objFile.Close
  13.  
  14. If InStr(strText, "InstallType=6") Then
  15. blnFound = True
  16. If blnFound Then
  17. End If
  18. WScript.quit
  19. else
  20.  
  21. strNewText = Replace(strText, "InstallType=2", "InstallType=6")
  22.  
  23. Set objFile = objFSO.OpenTextFile("C:\Program Files (x86)\IBM\Lotus\Notes\notes.ini", ForWriting) ' "Writes new InstallType"
  24. objFile.WriteLine strNewText
  25. objFile.Close
  26.  
  27. End If
  28.  
  29.  
  30. End If
  31.  
  32. wscript.quit ' Exits the script
Advertisement
Add Comment
Please, Sign In to add comment