Questions

Setting Extend my windows desktop onto this monitor without the GUI?

+
0 Votes
Locked

Setting Extend my windows desktop onto this monitor without the GUI?

jgrant_can
Hello, I hope someone can help. I've got 6 locked down and isolated environments of 150+ machines (XP Pro) furthest away is 24hrs. The users don't have access to the display settings through right clicking on the desktop or through the control panel. We have dual monitors connected to an ATI x1300 PCIe card and using the "Extend my windows desktop onto this monitor".

Every once in a while we receive a call saying the second monitor is no longer extended (normally cloning instead). Currently to fix this issue they call and I give a trusted user an account that has the appropriate permissions and then walk them through setting the Extend my desktop setting back and from there it works fine. I'm looking to automate this step hopefully as simply as possible.

Using a simply batch file I can open the Display settings panel using "%systemroot%\system32\control.exe desk.cpl,@0,3" however they still have to know to click on the second monitor and to select "Extend my desktop...". So ideally I'm looking for something that the users can click on without a GUI or other questions/interactions.

Any suggestions would be helpful. Thanks in advance.
  • +
    0 Votes
    jgrant_can

    I've found a solution for our environment it's to use a VB script this will re-enable the extend desktop setting on demand.
    Unfortunatly it uses the gui but no interaction from the user is needed.

    FYI: I was able to get the extend desktop to turn off but not turn back on using the registry keys. I did a search and found 11 instances (found only 4 of the 11 with the key set to 1) of the ATTACH.TODesktop registry key.
    example:
    HKLM\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\{C3BFE9BD-.....}\0000 and then under \Mon10000080

    --vbscript-------
    Option Explicit
    Dim WshShell, Dummy, Splash

    On Error Resume Next

    Set WshShell = WScript.CreateObject("WScript.Shell")

    'Main
    Call DoIt
    WScript.Quit

    Sub DoIt
    wshshell.Run("%systemroot%\system32\control.exe desk.cpl,@0,3")

    ' Give Display Properties time to load
    WScript.Sleep 1000
    WshShell.SendKeys "2"
    WScript.Sleep 10
    WshShell.SendKeys "%E"
    WScript.Sleep 500
    WshShell.SendKeys "%A"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{ENTER}"
    End Sub 'DoIt
    -------------

    +
    0 Votes
    b372028

    Thanks for the tip. It works great.

  • +
    0 Votes
    jgrant_can

    I've found a solution for our environment it's to use a VB script this will re-enable the extend desktop setting on demand.
    Unfortunatly it uses the gui but no interaction from the user is needed.

    FYI: I was able to get the extend desktop to turn off but not turn back on using the registry keys. I did a search and found 11 instances (found only 4 of the 11 with the key set to 1) of the ATTACH.TODesktop registry key.
    example:
    HKLM\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\VIDEO\{C3BFE9BD-.....}\0000 and then under \Mon10000080

    --vbscript-------
    Option Explicit
    Dim WshShell, Dummy, Splash

    On Error Resume Next

    Set WshShell = WScript.CreateObject("WScript.Shell")

    'Main
    Call DoIt
    WScript.Quit

    Sub DoIt
    wshshell.Run("%systemroot%\system32\control.exe desk.cpl,@0,3")

    ' Give Display Properties time to load
    WScript.Sleep 1000
    WshShell.SendKeys "2"
    WScript.Sleep 10
    WshShell.SendKeys "%E"
    WScript.Sleep 500
    WshShell.SendKeys "%A"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{TAB}"
    WshShell.SendKeys "{ENTER}"
    End Sub 'DoIt
    -------------

    +
    0 Votes
    b372028

    Thanks for the tip. It works great.