Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting refresh rates remotely. 1

Status
Not open for further replies.

Rori

IS-IT--Management
Joined
Mar 10, 2004
Messages
10
Hi guys.

I've searched through to check if anyone has dealt with this before, to no avail.

I have a user about 12 hours north in Queensland and they have altered the refresh rate and no get an 'Out of Bounds' error. Due to SOE, the users have no rights for logging on, and aren't terribly tech saavy.

I can remote into the machine, however I have no option for monitor, or advanced. No real way to change the refresh rate that I can tell (I do obviously get to see the screen though.) Working on the basis that we have no monitors to 'use' other than the one on the box, does anyone have a regedit, or suggestions that might be able to allow me to reset the refresh to 60hz, so they can get back into the machine?

Thanks for your help guys

Rori
 
Can you walk them through Safe Mode and System Restore?

Are you not getting any any access to their Display Settings from your machine, no Monitor tab or no Adapter tab where you can change the modes (Refresh Rate) at your end?

This is probably a false lead and may have nothing to do with the Refresh Rate, but have a look around this key and value in the Registry.

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\{41BEAE0E-22DB-4ADE-BFFA-44ADC8DAFF6D}\0000\Mon22446688

DefaultSettings.VRefresh

Or do a search for the value "DefaultSettings.VRefresh" see if you can match it up with other machines and tie it up with the Refresh Rate.

Like I said, that value could be way off the mark, and on my machine it appears in several other keys. I only mention it because the data matched my Refresh Rate, but it could equally be referring to something else totally unrelated.
 
Here is a script that will do it. Sets the refresh rate and resolution.


Code:
'==========================================================================
'
' NAME: SetScreenResolution.vbs
'
' AUTHOR: Unknown
' DATE  : 6/9/2005
'
' COMMENT: <code posted by cuner on Tek-Tips.com>
'
'==========================================================================

On Error Resume Next

Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7

strComputer = "."
Set StdOut = WScript.StdOut

Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Hardware profiles\current\system\currentcontrolset\control\video"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys


For Each subkey In arrSubKeys

   subPath = strKeyPath & "\" & subkey
  
   oReg.EnumKey HKEY_LOCAL_MACHINE, subPath, arrVideoKeys       
   For Each videoKey In arrVideoKeys
    
    subVideoPath = strKeyPath & "\" & subkey & "\" & videoKey
 
       oReg.EnumValues HKEY_LOCAL_MACHINE, subVideoPath , arrEntryNames, arrValueTypes
  
    If isarray(arrValueTypes) = true Then 

    '***** reg write****

    strEntryName = "DefaultSettings.XResolution"
       dwValue = 1024
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,strEntryName,dwValue

    ytrEntryName = "DefaultSettings.YResolution"
       dwValue = 768
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,ytrEntryName,dwValue
   
   rtrEntryName = "DefaultSettings.VRefresh"
       dwValue = 75
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,rtrEntryName,dwValue

      ' ****  end write **** 
                 
 oReg.EnumKey HKEY_LOCAL_MACHINE, subVideoPath, arrVideoDetailKeys   
  
If isarray(arrVideoDetailKeys) = true Then 

    For Each videoDetailKey In arrVideoDetailKeys  
     
    oReg.EnumValues HKEY_LOCAL_MACHINE, subVideoPath & "\" & videoDetailKey, arrEntryNames, arrValueTypes

    '***** reg write****

    strEntryName = "DefaultSettings.XResolution"
       dwValue = 1024
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath & "\" & videoDetailKey,strEntryName,dwValue

    ytrEntryName = "DefaultSettings.YResolution"
       dwValue = 768
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath & "\" & videoDetailKey,ytrEntryName,dwValue
    
       rtrEntryName = "DefaultSettings.VRefresh"
       dwValue = 75
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,rtrEntryName,dwValue

' ****  end Write **** 

    Next
    Else 
End If 
    Else 
End If 
   Next
Next


strKeyPath2 = "SYSTEM\CurrentControlSet\Hardware profiles\current\system\currentcontrolset\SERVICES"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath2, arrSrvKeys


For Each subkey2 In arrSrvKeys

   subPath2 = strKeyPath2 & "\" & subkey2
  
   oReg.EnumKey HKEY_LOCAL_MACHINE, subPath2, arrsVideoKeys       
   For Each svideoKey In arrsVideoKeys
    
'***** reg write****

    strEntryName = "DefaultSettings.XResolution"
       dwValue = 1024
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subPath2 & "\" & svideoKey,strEntryName,dwValue

    ytrEntryName = "DefaultSettings.YResolution"
       dwValue = 768
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subPath2 & "\" & svideoKey,ytrEntryName,dwValue
       
       rtrEntryName = "DefaultSettings.VRefresh"
       dwValue = 75
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,rtrEntryName,dwValue

' ****  end Write ****     

    subVideoPath2 = strKeyPath2 & "\" & subkey2 & "\" & svideoKey

    oReg.EnumKey HKEY_LOCAL_MACHINE, subVideoPath2, arrsVideoDetailKeys   


    If isarray(arrsVideoDetailKeys) = true Then 
    For Each svideoDetailKey In arrsVideoDetailKeys   
    
       altpath =subVideoPath2 & "\" & svideoDetailkey


    '***** reg write****

    strEntryName = "DefaultSettings.XResolution"
       dwValue = 1024
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath2 & "\" & svideoDetailKey,strEntryName,dwValue

    ytrEntryName = "DefaultSettings.YResolution"
       dwValue = 768
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath2 & "\" & svideoDetailKey,ytrEntryName,dwValue
    
       rtrEntryName = "DefaultSettings.VRefresh"
       dwValue = 75
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,subVideoPath,rtrEntryName,dwValue

' ****  end Write ****     

    
    Next
Else 
End If 
   Next
Next

I hope you find this post helpful.

Regards,

Mark
 
Linney.

Thanks for your post. I did some research online before coming here, and found the same sort of suggestions, but didn't think to test it against a working machine. Thanks for the effort.

markdmac.

Awesome post. Huge thank you for getting this to me. Seriously chuffed. Got it set up to go, and then had the rug pulled out from under me. In my excitment this morning my boss asked what was going on.
"You're not running a vbs file on one of our machines!" then the 'What if's' started.

I'll be talking him around, or... something else.

Again, I appreciate your efforts (throughout tek-tips) and am sorry I've been 'red taped'.
 
Ah, the what ifs...

Have your boss take a look at this site. You will find I am listed as top MVP for Exchange 2003, Windows 2000, Windows 2003 and second for vbscript. Have your boss read my Bio. I'm a former MS employee. If all of that doesn't help persuade him I don't know what else to suggest.

I hope you find this post helpful.

Regards,

Mark
 
Give him a bill for a return flight to Cairns or wherever.
 
You're absolutely right Mark,

I managed to talk the user through logging on and accepting the Remote Access (keyboard only, and no vision) so I got to see the screen, and fix the problem, but then I went for a chat with my boss.

I managed to point out the MVP's, FAQ's you've written and that I've got access to the internet to take advantage of some of the most brilliant minds around the gear we use. To block it was a knee jerk, that I managed to explain.

The end result was "Use it." After that I told him we'd fixed it already, but I was going to make my point 8).

Again Mark... your work on here is awesome, and while I didn't use it, I'm thankful you posted.

 
Thanks for the follow up.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top