Guest User

fuckmylife

a guest
Jan 4th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 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. Else objFSO.FileExists("D:\Program Files (x86)\IBM\Lotus\Notes\notes.ini") Then
  29.  
  30. Const ForReading = 1
  31. Const ForWriting = 2
  32.  
  33. Set objFSO = CreateObject("Scripting.FileSystemObject")
  34. Set objFile = objFSO.OpenTextFile("D:\Program Files (x86)\IBM\Lotus\Notes\notes.ini", ForReading) ' Read the file for "InstallType =2"
  35.  
  36. strText = objFile.ReadAll
  37. objFile.Close
  38.  
  39. If InStr(strText, "InstallType=6") Then
  40. blnFound = True
  41. If blnFound Then
  42. End If
  43. WScript.quit
  44. else
  45.  
  46. strNewText = Replace(strText, "InstallType=2", "InstallType=6")
  47.  
  48. Set objFile = objFSO.OpenTextFile("D:\Program Files (x86)\IBM\Lotus\Notes\notes.ini", ForWriting) ' "Writes new InstallType"
  49. objFile.WriteLine strNewText
  50. objFile.Close
  51.  
  52. ElseIf objFSO.FileExists("C:\Program Files\IBM\Lotus\Notes\notes.ini") Then
  53.  
  54. Const ForReading = 1
  55. Const ForWriting = 2
  56.  
  57. Set objFSO = CreateObject("Scripting.FileSystemObject")
  58. Set objFile = objFSO.OpenTextFile("C:\Program File\IBM\Lotus\Notes\notes.ini", ForReading) ' Read the file for "InstallType =2"
  59.  
  60. strText = objFile.ReadAll
  61. objFile.Close
  62.  
  63. If InStr(strText, "InstallType=6") Then
  64. blnFound = True
  65. If blnFound Then
  66. End If
  67. WScript.quit
  68. else
  69.  
  70. strNewText = Replace(strText, "InstallType=2", "InstallType=6")
  71.  
  72. Set objFile = objFSO.OpenTextFile("C:\Program File\IBM\Lotus\Notes\notes.ini", ForWriting) ' "Writes new InstallType"
  73. objFile.WriteLine strNewText
  74. objFile.Close
  75.  
  76.  
  77. End If
  78.  
  79. End If
  80.  
  81. wscript.quit ' Exits the script
Advertisement
Add Comment
Please, Sign In to add comment