Jump to content

Recommended Posts

Posted

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%092Program 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%092Program 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%092Program 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.

Posted

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

 

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

  • Thanks 1
Posted (edited)
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

 

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 ...

 

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 : )

Edited by Robot
Posted

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.

  • Thanks 1
Posted
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 :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...