Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #What display user want
- $WhichDisplay = Read-Host -Prompt 'Input main display for hearthstone'
- #Setting it in reg
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Blizzard Entertainment\Hearthstone\" -Name UnitySelectMonitor_h17969598 -Value ($WhichDisplay-1)
- #For cross reference against the windows monitor info
- $Display = "DISPLAY$Whichdisplay"
- #Getting info from the system
- $Monitors = [System.Windows.Forms.Screen]::AllScreens
- foreach ($Monitor in $Monitors)
- {
- $DeviceName = (($Monitor.DeviceName).replace("\", "")).replace(".", "")
- if( $DeviceName -eq $Display)
- {
- $Width = $Monitor.bounds.Width
- $Height = $Monitor.bounds.Height
- }
- }
- #Set local user
- $p = $ENV:UserProfile
- #File to change
- $file = "$p\AppData\Local\Blizzard\Hearthstone\options.txt"
- #Get file content and store it into $content variable
- $content = Get-Content -Path $file
- #Check and change
- $i=0
- $u=0
- While ($content[$i] -ne $null)
- {if ($content[$i] -match "graphicsheight")
- {$content[$i] = "graphicsheight=$Height"}
- $i++
- }
- While ($content[$u] -ne $null)
- {if ($content[$u] -match "graphicswidth")
- {$content[$u] = "graphicswidth=$Width"}
- $u++
- }
- # Set the new content
- $content | Set-Content -Path $file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement