Message box to make sure you want to launch qBitorrent (For NAS users)

Windows specific questions, problems.
Post Reply
Zuwolf

Message box to make sure you want to launch qBitorrent (For NAS users)

Post by Zuwolf »

I sometimes start qBitorrent but I forget that my NAS isn't ON.
In that case qBitorrent cannot find the files so it need to recheck the integrity of every torrent next time you launch it with your NAS ON, using actively the HDDs and lowering their life span.

So I made a little Visual Basic message box to make sure you want to launch qBitorrent.

Image

You click yes, it launch qBitorrent, you click No, it close the message box. Simple.

I don't know much about programming so I had a look on the internet and found this topic on StackOverflow

Thanks to the user Hackoo I made the following script that I saved as 'Launch qBitorrent.vbs' thanks to Notepad++:

Code: Select all

Option Explicit
Dim ws,Question,PathProgram
Set ws = CreateObject("wscript.shell")
'change the path of your batch file
PathProgram = "C:\Program Files\qBittorrent\qbittorrent.exe"
Question = Msgbox("You're about to launch qBitorrent" & vbCrLf & " " & vbCrLf & "is the NAS ON ?",VbYesNO + VbQuestion, "qBitorrent")
If Question = VbYes Then
     ws.run DblQuote(PathProgram)
End If
'***************************************
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'***************************************
Now because I launch qBittorent from my taskbar, I wanted to replace qBitorrent shortcut. Sadly it doesn't really work natively so I had to use a workaround thanks to n.caillou that I found on StackOverflow again
So you need to create a new shortcut that point to where you saved your script and insert

Code: Select all

wscript "C:\Program Files\qBittorrent\Launch qbitorrent.vbs"
then you just need to change the shortcut icon and move the new shorcut to your taskbar.

You can place the 2 files anywhere on your computer but you'll have to change the paths accordingly.
In my case I setup the 2 files into qBitorrent native install path

If you're lazy to do it yourself, you can find the script and the shortcut in the attachment below to unzip into qBitorrent install path.
Attachments
Message box to launch qBittorrent.zip
Message box to make sure you want to launch qBitorrent.
You click yes, it launch qBitorrent, you click No, it close the message box.
(1.47 KiB) Downloaded 83 times
Post Reply