Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const ForReading = 1
- Const ForWriting = 2
- strFileName = "C:\Users\wCGar\AppData\Roaming\deluge\state\torrents.state"
- strOldText = "/mnt/dataDrive/Downloads"
- strNewText = "S:\\Downloads"
- strDelugeLoc = "C:\Program Files (x86)\Deluge\deluge.exe"
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
- Set wshShell = CreateObject("Wscript.Shell")
- strText = objFile.ReadAll
- objFile.Close
- strNewText = Replace(strText, strOldText, strNewText)
- Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
- objFile.WriteLine strNewText
- objFile.Close
- wshShell.Run chr(34) & strDelugeLoc & chr(34), 1, FALSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement