Guest User

Untitled

a guest
Aug 8th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Set path to ITG
  2. itgfolder = "c:\ITG\"
  3.  
  4. 'Get current resolution of screen 1
  5. Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2")
  6. Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)
  7. For Each objItem in colItems
  8. intHorizontal = objItem.ScreenWidth
  9. intVertical = objItem.ScreenHeight
  10. Next
  11.  
  12.  
  13. 'Replace display width and height in StepMania.ini
  14. Const ForReading=1
  15. Const ForWriting=2
  16. Set objFSO = CreateObject("Scripting.FileSystemObject")
  17. filePath = itgfolder & "Data\" & "StepMania.ini"
  18. Set myFile = objFSO.OpenTextFile(filePath, ForReading, True)
  19. Set myTemp= objFSO.OpenTextFile(filePath & ".tmp", ForWriting, True)
  20. Do While Not myFile.AtEndofStream
  21.  myLine = myFile.ReadLine
  22.  If InStr(myLine, "DisplayWidth") Then
  23.   myLine = "DisplayWidth=" & intHorizontal
  24.  End If
  25.  If InStr(myLine, "DisplayHeight") Then
  26.   myLine = "DisplayHeight=" & intVertical
  27.  End If
  28.  
  29.  myTemp.WriteLine myLine
  30. Loop
  31. myFile.Close
  32. myTemp.Close
  33. objFSO.DeleteFile(filePath)
  34. objFSO.MoveFile filePath&".tmp", filePath
  35.  
  36.  
  37. 'Run subroutine
  38. Sub Run(ByVal sFile)
  39. Dim shell
  40.  
  41.     Set shell = CreateObject("WScript.Shell")
  42.     shell.Run Chr(34) & sFile & Chr(34), 1, false
  43.     Set shell = Nothing
  44. End Sub
  45.  
  46. Run itgfolder & "Program\OpenITG-PC-SSE2"
  47.  
  48. 'Thanks for all the fish
Add Comment
Please, Sign In to add comment