Writing to Registry

Discussion in 'Python' started by Samantha, Nov 16, 2006.

  1. Samantha

    Samantha Guest

    I am working with this recipes:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011

    The problem I am having is setting a hex value.
    This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ,
    r"c:\winnt\explorer.exe")
    I want something Like -- SetValueEx(aKey,"MyNewSize",0, REG_SZ, 120 or
    some value)
    Help would be appreciated.
    S
    Samantha, Nov 16, 2006
    #1
    1. Advertising

  2. At Thursday 16/11/2006 20:48, Samantha wrote:

    >I am working with this recipes:
    >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011
    >
    >The problem I am having is setting a hex value.
    >This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ,
    >r"c:\winnt\explorer.exe")
    >I want something Like -- SetValueEx(aKey,"MyNewSize",0, REG_SZ, 120 or
    >some value)


    Usually when you don't know how to use a certain function, you begin
    by reading the documentation for it:
    http://docs.python.org/lib/module--winreg.html#l2h-5827


    --
    Gabriel Genellina
    Softlab SRL

    __________________________________________________
    Correo Yahoo!
    Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
    ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
    Gabriel Genellina, Nov 17, 2006
    #2
    1. Advertising

  3. Samantha

    Samantha Guest

    Thanks for the link.
    S
    "Gabriel Genellina" <> wrote in message
    news:...
    > At Thursday 16/11/2006 20:48, Samantha wrote:
    >
    >>I am working with this recipes:
    >>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011
    >>
    >>The problem I am having is setting a hex value.
    >>This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ,
    >>r"c:\winnt\explorer.exe")
    >>I want something Like -- SetValueEx(aKey,"MyNewSize",0, REG_SZ, 120 or
    >>some value)

    >
    > Usually when you don't know how to use a certain function, you begin by
    > reading the documentation for it:
    > http://docs.python.org/lib/module--winreg.html#l2h-5827
    >
    >
    > --
    > Gabriel Genellina
    > Softlab SRL
    > __________________________________________________
    > Correo Yahoo!
    > Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu
    > cuenta ya! - http://correo.yahoo.com.ar
    Samantha, Nov 17, 2006
    #3
  4. Samantha

    Mark Elston Guest

    Note: this is untested (since I don't like screwing around
    in the registry...)

    Have you tried using REG_DWORD?

    Mark
    * Samantha wrote (on 11/16/2006 3:48 PM):
    > I am working with this recipes:
    > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66011
    >
    > The problem I am having is setting a hex value.
    > This line --- SetValueEx(aKey,"MyNewKey",0, REG_SZ,
    > r"c:\winnt\explorer.exe")
    > I want something Like -- SetValueEx(aKey,"MyNewSize",0, REG_SZ, 120 or
    > some value)
    > Help would be appreciated.
    > S
    >
    >
    Mark Elston, Nov 17, 2006
    #4
  5. At Thursday 16/11/2006 21:39, Samantha wrote:

    > > http://docs.python.org/lib/module--winreg.html#l2h-5827

    >Thanks for the link.


    Notice that surely you already have the full Python documentation, it
    comes with the standard distribution.


    --
    Gabriel Genellina
    Softlab SRL

    __________________________________________________
    Correo Yahoo!
    Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
    ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
    Gabriel Genellina, Nov 17, 2006
    #5
  6. Samantha

    Samantha Guest

    That was the fix.
    S

    "Mark Elston" <> wrote in message
    news:...
    > Note: this is untested (since I don't like screwing around
    > in the registry...)
    >
    > Have you tried using REG_DWORD?
    >
    > Mark
    >>
    Samantha, Nov 17, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HK
    Replies:
    1
    Views:
    3,632
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. Replies:
    0
    Views:
    752
  3. Leny
    Replies:
    3
    Views:
    16,927
    Daniel
    Feb 1, 2005
  4. Tony
    Replies:
    0
    Views:
    353
  5. Collin Miller
    Replies:
    10
    Views:
    596
    Roger Pack
    Jul 9, 2010
Loading...

Share This Page