Question about shortcuts for Registry values


  1. Posts : 72
    Windows 7 Ultimate x32 (UPDATE: Now x64!)
       #1

    Question about shortcuts for Registry values


    Greetings my fellow Landwalkers,

    I created a 'NoTrayItemDisplay' DWORD with a value of 1 for a program. What I want to know is, can I create shortcuts to modify/change it's value from 1 to 0 and vice versa?

    The ideal solution for me would be creating two shortcuts; one which modifies the value to 0 and another which modifies the value to 1.

    The perfect solution for me would be some sort of Value Toggle which can toggle between both values...

    So, how do I do either of the above solutions? Or is there another solution out there?
      My Computer


  2. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #2

    What is the registry location?
      My Computer


  3. Posts : 72
    Windows 7 Ultimate x32 (UPDATE: Now x64!)
    Thread Starter
       #3

    Dwarf said:
    What is the registry location?
    If you are referring to the place where the DWORD is located, then it is
    " Computer\KEY_CURRENT_USER\Software\BitTorrent\uTorrent "

    Sorry, I'm a bit of a...scratch that, I AM a noob in these matters. Remember how I said I created a DWORD, well I had to follow step by step instructions to do so...
      My Computer


  4. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #4

    Here you go. Copy and paste the codes below into Notepad and save them with a suitable name, giving them a .bat extension.

    Code:
    @ECHO OFF
    REG ADD "HKCU\Software\BitTorrent\uTorrent" /v "NoTrayItemDisplay" /t REG_DWORD /d "00000000" /f
    Code:
    @ECHO OFF
    REG ADD "HKCU\Software\BitTorrent\uTorrent" /v "NoTrayItemDisplay" /t REG_DWORD /d "00000001" /f
      My Computer


  5. Posts : 72
    Windows 7 Ultimate x32 (UPDATE: Now x64!)
    Thread Starter
       #5

    Dwarf said:
    Here you go. Copy and paste the codes below into Notepad and save them with a suitable name, giving them a .bat extension.

    Code:
    @ECHO OFF
    REG ADD "HKCU\Software\BitTorrent\uTorrent" /v "NoTrayItemDisplay" /t REG_DWORD /d "00000000" /f
    Code:
    @ECHO OFF
    REG ADD "HKCU\Software\BitTorrent\uTorrent" /v "NoTrayItemDisplay" /t REG_DWORD /d "00000001" /f
    Hmmmm, most odd...I tried that and the value does seem to change when I check in Regedit but now, whatever I set the value to, uTorrent seems to open with the icon. Before I created the shortcut, setting the value to 1 manually used to stop the icon...what did I do wrong??
      My Computer


  6. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #6

    Here is a VBScript to flip it back and forth.

    Code:
     
    ' Change Registry Key v1.1.1
    ' Programmed WindowsStar - Copyright (c) 2010
    ' ---------------------------------------------------
    On Error Resume Next
    Set WShShell = WScript.CreateObject("WScript.Shell")
    Value = WSHShell.RegRead ("HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay")
    If Value = "0" Then
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000001, "REG_DWORD"
    Else
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000000, "REG_DWORD"
    End If
    WshShell.Popup "          Done!",5,"Script Message"
    Question about shortcuts for Registry values Attached Files
      My Computer


  7. Posts : 72
    Windows 7 Ultimate x32 (UPDATE: Now x64!)
    Thread Starter
       #7

    WindowsStar said:
    Here is a VBScript to flip it back and forth.

    Code:
     
    ' Change Registry Key v1.1.1
    ' Programmed WindowsStar - Copyright (c) 2010
    ' ---------------------------------------------------
    On Error Resume Next
    Set WShShell = WScript.CreateObject("WScript.Shell")
    Value = WSHShell.RegRead ("HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay")
    If Value = "0" Then
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000001, "REG_DWORD"
    Else
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000000, "REG_DWORD"
    End If
    WshShell.Popup "          Done!",5,"Script Message"
    Thanks!
      My Computer


  8. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #8

    t4akawolf said:
    WindowsStar said:
    Here is a VBScript to flip it back and forth.

    Code:
     
    ' Change Registry Key v1.1.1
    ' Programmed WindowsStar - Copyright (c) 2010
    ' ---------------------------------------------------
    On Error Resume Next
    Set WShShell = WScript.CreateObject("WScript.Shell")
    Value = WSHShell.RegRead ("HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay")
    If Value = "0" Then
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000001, "REG_DWORD"
    Else
       WSHShell.RegWrite "HKCU\Software\BitTorrent\uTorrent\NoTrayItemDisplay", 00000000, "REG_DWORD"
    End If
    WshShell.Popup "          Done!",5,"Script Message"
    Thanks!
    You are very welcome.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:18.
Find Us