Advertisement
CGar

Dual Boot Deluge Startup Script

Jan 21st, 2015
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Const ForReading = 1
  2. Const ForWriting = 2
  3.  
  4. strFileName = "C:\Users\wCGar\AppData\Roaming\deluge\state\torrents.state"
  5. strOldText = "/mnt/dataDrive/Downloads"
  6. strNewText = "S:\\Downloads"
  7.  
  8. strDelugeLoc = "C:\Program Files (x86)\Deluge\deluge.exe"
  9.  
  10. Set objFSO = CreateObject("Scripting.FileSystemObject")
  11. Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
  12. Set wshShell = CreateObject("Wscript.Shell")
  13.  
  14. strText = objFile.ReadAll
  15. objFile.Close
  16. strNewText = Replace(strText, strOldText, strNewText)
  17.  
  18. Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
  19. objFile.WriteLine strNewText
  20. objFile.Close
  21.  
  22. wshShell.Run chr(34) & strDelugeLoc & chr(34), 1, FALSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement