+ Post New Thread
Results 1 to 7 of 7
Windows Thread, Changing DWORD values in Technical; Hey, I need to change some Registry DWORD Values on multiple PCs. All of the values that I need to ...
  1. #1
    Robot's Avatar
    Join Date
    Oct 2009
    Location
    Leeds
    Posts
    82
    Thank Post
    23
    Thanked 7 Times in 7 Posts
    Rep Power
    13

    Changing DWORD values

    Hey,

    I need to change some Registry DWORD Values on multiple PCs.


    All of the values that I need to change are within the following strpath...
    HKEY_CURRENT_USER\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\User.Name \Settings


    The issue that I am having is that on one PC, which is used by a users with the username User.1 the registry string is
    HKEY_CURRENT_USER\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\User.1\Settings


    On another PC with User.2 logging in, the string is
    HKEY_CURRENT_USER\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\User.2\Settings


    Is there any way of getting past this? I have tried putting %username% in place of where their usernames appear but this did not work.

    Cheers.

  2. #2
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,007
    Thank Post
    124
    Thanked 286 Times in 263 Posts
    Rep Power
    109
    What method are you using to try and do this? In VB script you could build the line by expanding the username environment variable.

    eg

    Code:
    Set oShell = CreateObject( "WScript.Shell" )
    strUser=oShell.ExpandEnvironmentStrings("%UserName%")
    strRegKey = "HKCU\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\" & strUser & "\Settings"
    ' add reg key code here

  3. Thanks to ChrisH from:

    Robot (22nd December 2009)

  4. #3
    Robot's Avatar
    Join Date
    Oct 2009
    Location
    Leeds
    Posts
    82
    Thank Post
    23
    Thanked 7 Times in 7 Posts
    Rep Power
    13
    Quote Originally Posted by ChrisH View Post
    What method are you using to try and do this? In VB script you could build the line by expanding the username environment variable.

    eg

    Code:
    Set oShell = CreateObject( "WScript.Shell" )
    strUser=oShell.ExpandEnvironmentStrings("%UserName%")
    strRegKey = "HKCU\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\" & strUser & "\Settings"
    ' add reg key code here
    Edit - Spoke too soon :P

    Thanks Chris...
    Could I ask for some help on writing the rest to change the DWORD Values too please, I have just give it a go and received an error in my code

    I tried ...

    Code:
    Set oShell = CreateObject( "WScript.Shell" )
    strUser=oShell.ExpandEnvironmentStrings("%UserName%")
    strRegKey = "HKCU\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\" & strUser & "\Settings\UserPresence"
    ' add reg key code here
    strValueName = "BeRightBackTimeoutActive"
    dwValue = 82
    Am I missing something or doing it wrong all together??

    Thanks : )
    Last edited by Robot; 22nd December 2009 at 03:06 PM.

  5. #4
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,007
    Thank Post
    124
    Thanked 286 Times in 263 Posts
    Rep Power
    109
    Code:
    Set oShell = CreateObject( "WScript.Shell" )
    strUser=oShell.ExpandEnvironmentStrings("%UserName%")
    strRegKey = "HKCU\Software\Zultys\MXUser\C%058%092 Program Files%092Zultys%092MXIE%092Bin%092\Users\" & strUser & "\Settings"
    
    oShell.RegWrite strRegKey & "BeRightBackTimeoutActive",82,"REG_DWORD"
    Should be something like that. I may have my methods mixed up so untested at your own risk etc etc.

  6. Thanks to ChrisH from:

    Robot (22nd December 2009)

  7. #5
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,007
    Thank Post
    124
    Thanked 286 Times in 263 Posts
    Rep Power
    109
    If it still shows an error it may need an extra "\" on the end of the path.

  8. Thanks to ChrisH from:

    Robot (22nd December 2009)

  9. #6
    Robot's Avatar
    Join Date
    Oct 2009
    Location
    Leeds
    Posts
    82
    Thank Post
    23
    Thanked 7 Times in 7 Posts
    Rep Power
    13
    Quote Originally Posted by ChrisH View Post
    If it still shows an error it may need an extra "\" on the end of the path.
    Nope, went straight through and did what I wanted. Thanks very much

  10. #7
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,007
    Thank Post
    124
    Thanked 286 Times in 263 Posts
    Rep Power
    109
    Quote Originally Posted by Robot View Post
    Nope, went straight through and did what I wanted. Thanks very much
    No problem.



SHARE:
+ Post New Thread

Similar Threads

  1. moodle ldap default values if not set by AD
    By russdev in forum Virtual Learning Platforms
    Replies: 12
    Last Post: 8th June 2010, 12:46 PM
  2. Powershell modify multi-string values in AD
    By maf_001 in forum Scripts
    Replies: 1
    Last Post: 28th August 2009, 02:12 PM
  3. Compare Values Above, Equal and Below
    By TwyloII in forum How do you do....it?
    Replies: 7
    Last Post: 16th January 2009, 01:20 PM
  4. Multiple Values In Case KixStart Statement
    By DaveP in forum How do you do....it?
    Replies: 2
    Last Post: 14th January 2009, 05:39 PM
  5. Exchange 2007 > *SPAM* SCL values
    By Ben_Stanton in forum Windows
    Replies: 2
    Last Post: 13th November 2008, 02:58 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •