Jump to content

WINDOWS: Batch file to toggle whether uTorrent loads on startup.


mickeym191

Recommended Posts

This script finds out whether µTorrent is set to startup automatically in Windows. If so, it deletes the startup value. If not, it adds a registry value to start µTorrent minimized. This is assuming you have installed µTorrent in the default location on a Windows PC. I've verified this to work on Windows 7, 64-bit.

This doesn't actually change the "Start µTorrent when Windows Starts" checkbox in preferences, as I'm too lazy to hunt down the registry key necessary for that (if it exists), but if you have that setting unchecked in µTorrent, running this batch script should detect whether µTorrent will startup or not and set the opposite to true. This can be useful, for instance, if you have µTorrent set to start up each reboot but want to change that after a certain download completes.

Simply open notepad, paste this in there, save it as a .bat and you can run it whenever you'd like to toggle µTorrent's startup setting.

Windows 64-bit (x64)

@echo off

reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /f "C:" /d || goto Disabled

::Disable

reg Delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /f

goto done

::pause

:Disabled

reg Add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /t REG_SZ /d "C:\\Program Files (x86)\\uTorrent\\uTorrent.exe /MINIMIZED" /f

goto done

:done

::pause

Windows 32-bit (x86)

@echo off

reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /f "C:" /d || goto Disabled

::Disable

reg Delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /f

goto done

::pause

:Disabled

reg Add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v uTorrent /t REG_SZ /d "C:\\Program Files\\uTorrent\\uTorrent.exe /MINIMIZED" /f

goto done

:done

::pause

Note: I've commented out the pauses in the process, but you can temporarily remove the "::" and remove the "off" after "@echo" to verify the script is working as it should.

Just thought I'd share, and save someone the hassle. I'm sure I'm not the only one that could use it. What I've personally done is created a shortcut to the .bat on my desktop, changed the shortcuts icon to a switch and set the shortcut to run minimized. I just double-click the icon when I want to toggle the startup state of µTorrent.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...