Not enough ratings
OVER WATCHでSteamオーバーレイを使う方法
By w1nter
   
Award
Favorite
Favorited
Unfavorite
はじめに
個人的覚え書き,タイトル空白ミスったけどゆるし亭
.

Launcher = "Overwatch Launcher.exe"
Client = "Overwatch.exe"

' if nothing was passed in, we are starting from scratch, so start the launcher
If WScript.Arguments.length = 0 Then
Home = WScript.ScriptFullName
Home = Left(Home, InStr(Home, WScript.ScriptName)-1)

'run the launcher
Set objShell = WScript.CreateObject("Shell.Application")
objShell.ShellExecute Launcher, "", Home

' create the file that the elevated script will copy executables's path and commandline to
set fso = CreateObject("Scripting.FileSystemObject")
set tempfolder = fso.GetSpecialFolder(2)
tempname = tempfolder & "\" & "steam.tmp"
set tempfile = fso.CreateTextFile(tempname)
tempfile.close()

'run this script but signal that it needs to elevate by giving it the tempfile name as an argument
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "cscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " " & tempname, "", "runas", 2

WScript.Echo "Waiting for other script to finish..."
' check every second if the temporary file has been updated with the commandline info
Do While True
'check the filesize of the tempfile
set tempfile = fso.GetFile(tempname)
If tempfile.Size > 0 Then Exit Do
WScript.Sleep 1000
Loop

ExecutablePath = Home
set tempfile = fso.OpenTextFile(tempname)
CommandLine = tempfile.ReadLine
tempfile.close()

Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute Client, CommandLine, ExecutablePath

fso.DeleteFile tempname
WScript.Quit
Else
' we are elevated now
WScript.Echo "Waiting for launcher to start client..."

'Get Windows Manager object
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")

' check every second for client that was launched by launcher
While True

'Get info on processes named Client
Set InstanceList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = '" & Client & "'")

for Each Instance in InstanceList
cmdline = Instance.CommandLine

'we found the client we care about
Instance.Terminate()

'remove the exe path and name from the cmdline
position = InStr(1, cmdline, """ ") + 1
cleanCmdLine = Right(cmdline, Len(cmdline) - position)

tempname = WScript.Arguments(0)
set fso = CreateObject("Scripting.FileSystemObject")
set tempfile = fso.OpenTextFile(tempname, 2)
tempfile.WriteLine(cleanCmdLine)
tempfile.close()

WScript.Quit
Next

WScript.Sleep 1000
Wend
End If


上記コードをメモ帳等にコピーして"steamoverlay.vbs"という名前で保存する


保存したファイルをOW本体と同じ場所へ移動する
https://steamuserimages-a.akamaihd.net/ugc/951848302304116410/0525EE313F6CA7FBF13163834AD3F33A2F9AF8F7/?imw=256&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false


Steamクライアントのライブラリより右下のゲームを追加→非 Steamゲームを追加でoverwatchを選択


追加されたoverwatchを右クリックでプロパティを開く

https://steamuserimages-a.akamaihd.net/ugc/951848302304143069/6C00EA89604302F58FDDBF293DB524CF3B43D76A/?imw=256&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false

リンク先を
"C:\Windows\System32\cscript.exe" "[EXE Directory]\Overwatch\steamoverlay.vbs"
※[EXE Directory]にはOW本体のあるファイルを入力
作業フォルダを
"C:\Windows\System32\"
へ変更する


Steamクライアントのoverwatchを開きプレイをクリック
※このとき出てくるDOS窓を消さないこと


終わり
3 Comments
Public Enemy Aug 20, 2021 @ 10:42am 
:louie::balloon::handhorns::levkahype::skull_metal:
𝕱𝖊𝖊𝖑𝖎𝖓𝖌𝖘 May 24, 2021 @ 10:07am 
˗ˏ:lifehope:ˎ˗
w1nter  [author] Dec 28, 2018 @ 7:50am 
ちなみにクライアント通さないゲームはそのままライブラリからゲームを追加→非Steamゲームを追加→steamクライアントから起動だけでオーバーレイ使えます