Jump to content

set dl/ul speed from commandline


nirandone

Recommended Posts

I know it's already been kind of requested for commandline options etc.

But to be able to set download and upload speed from commandline would really be helpful to us who have VOIP telephony. So that when I receive a call and answer, another program would sense the status being changed for the phone adapter to 'connected', and execute a command, or let's say a batch file (that can execute several commands), that changes the the upload speed for µTorrent. That way we can ensure that the call will get great sound quality.

Not all of us have a router with good QoS functionality built in, so a good solution then is to cap the computers running any P2P applications.

This can also be done with some bandwidth limiting/traffic shaping program on the computers running the P2P app, but they tend to be quite unstable for me. I'd rather see that I can just execute a commandline option...

Link to comment
Share on other sites

Yeah, that idea is good i think. And i have one ide too: a hotkey assigned to "scheduler on", and an another to "scheduler off".

I want to make a program, that ping my neighbour (shared adsl with him), and if his computer is on, then limit my connection. With this commandline options, or the hotkeys, i can finish this program.

Link to comment
Share on other sites

I've solved my problem by using VBscript with the sendkeys command. So the script controls µTorrent through the GUI.

No need for commandline options or hotkeys. If it can be done in the GUI, then you can let a script do it for you.

I think this will be very useful for you too lidi!

I learned how to do it here: http://mcpmag.com/columns/rss.asp?editorialsid=1230

This is how my code looks like that will set the upload to 500 kB/s:

Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run Chr(34) & "C:\Program Files\utorrent.exe" & Chr(34),,False

WScript.Sleep 1000

objShell.AppActivate "µTorrent 1.5"

WScript.Sleep 5

' Open the Preferences menu
' For some reason it would not work with ^{p} (Ctrl+P)
' so the script sends Alt+O and Enter instead
objShell.SendKeys "%{o}"
WScript.Sleep 5
objShell.SendKeys "{ENTER}"
WScript.Sleep 5

' Go to Network using Shift+Tab and Down
objShell.SendKeys "+{TAB}"
WScript.Sleep 5
objShell.SendKeys "+{TAB}"
WScript.Sleep 5
objShell.SendKeys "+{TAB}"
WScript.Sleep 5
objShell.SendKeys "{DOWN}{DOWN}{DOWN}"
WScript.Sleep 5

' Go to Bandwidth Limiting
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5
objShell.SendKeys "{TAB}"
WScript.Sleep 5

' Set the Maximum Upload Rate
objShell.SendKeys "500{ENTER}"
WScript.Sleep 5

' Minimize µTorrent
objShell.SendKeys "%"
WScript.Sleep 5
objShell.SendKeys "{DOWN}"
WScript.Sleep 5
objShell.SendKeys "{LEFT}"
WScript.Sleep 5
objShell.SendKeys "{DOWN}{DOWN}{DOWN}"
WScript.Sleep 5
objShell.SendKeys "{ENTER}"

Link to comment
Share on other sites

Thanks for the code above, but i knew only a little c++. I try to convert it to c.

I solved my problem with macro express, and a tiny c++ application. The c app, "press" a hotkey, then the rest is done by the macro. Sets the limits with mouse movements, and keypresses, in the gui.

But it would be nice, if we can control uTorrent, like winamp does. With SendMessage.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...