Results 1 to 9 of 9

Thread: howto: set windows system variables with Qt

  1. #1
    Join Date
    Feb 2007
    Posts
    4
    Thanks
    3

    Default howto: set windows system variables with Qt

    simple question:
    howto: set windows system variables with Qt
    is there a way 2 do this with Qt?

    cheers fil

  2. #2
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: howto: set windows system variables with Qt

    How about
    Qt Code:
    1. system("set path <reqd value>");
    To copy to clipboard, switch view to plain text mode 
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  3. The following user says thank you to Gopala Krishna for this useful post:

    informatics (10th July 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    4
    Thanks
    3

    Default Re: howto: set windows system variables with Qt

    ok thx!

    but then it would be
    Qt Code:
    1. system("set path=<reqd value>");
    To copy to clipboard, switch view to plain text mode 

    ok and how do i get one

    thanks!

    cheers fil

  5. #4
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: howto: set windows system variables with Qt

    Ok thanks for correcting. I generally don't use windows
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  6. #5
    Join Date
    Feb 2007
    Posts
    4
    Thanks
    3

    Default Re: howto: set windows system variables with Qt

    i know i'm one of the singles developing on windows

    btw.: u know how 2 get an environment variable?

  7. #6
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: howto: set windows system variables with Qt

    BTW the environment variable might not be set permanently. Probably the variable might me reset just after system function.
    So i'm not sure whether it works or not.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  8. #7
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: howto: set windows system variables with Qt

    Quote Originally Posted by informatics View Post
    btw.: u know how 2 get an environment variable?
    getenv()

    Found this link in google http://www.informit.com/guides/conte...eqNum=136&rl=1
    It might help you.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  9. The following user says thank you to Gopala Krishna for this useful post:

    informatics (10th July 2007)

  10. #8
    Join Date
    Apr 2007
    Location
    Ilsfeld, Germany
    Posts
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: howto: set windows system variables with Qt

    Hi,

    QProcess supports accessing environment variables for the current process with environment(), setEnvironment() and QProcess::systemEnvironment().

    To change the system's environment you probably have to change the registry, see: http://msdn2.microsoft.com/en-us/library/ms682653.aspx

    HTH, Bernd

  11. #9
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: howto: set windows system variables with Qt

    Please take into account that in many corporate systems, users are not administrators and are not guaranteed to have read/write access in the HKLM where these keys are maintained (actually its HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Executive\Path). This had been the source of many a jolly issue where HKLM registry keys are being opened with KEY_ALL_ACCESS which subsequently fails (in other peoples apps i should add)

    Pete

  12. The following user says thank you to pdolbey for this useful post:

    informatics (18th July 2007)

Similar Threads

  1. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.