Toate discuțiile > Forumuri Steam > Help and Tips > Detaliile subiectului
[SOLVED/CLOSE] How to Run NonSteam Game with Launcher?
How do you run a NonSteam game that has a launcher? For example, StarWars TheOldRepublic starts with a launcher, then opens the game. No matter if running as administrator or not, the game opens in Steam with launcher but then closes when the main game starts. I can't find a single solution online.
Editat ultima dată de Shuaizu; 24 mart. 2017 la 20:03
< >
Se afișează 1-12 din 12 comentarii
mimizukari 24 mart. 2017 la 18:30 
you can't, unless it just works, like it did for some games like anarchy online(on steam now tho)
Editat ultima dată de mimizukari; 24 mart. 2017 la 18:30
Bench 24 mart. 2017 la 19:02 
You can.

Step 1 (script):
copy paste this script into a plain text editor (ex. notepad) and save it as "steamswtor.vbs" in the same directory as your swtor launcher (ex. "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic"):


' if nothing was passed in, we are starting from scratch, so start the launcher If WScript.Arguments.length = 0 Then swtorHome = WScript.ScriptFullName swtorHome = Left(swtorHome, InStr(swtorHome, WScript.ScriptName)-1) 'run the launcher Set objShell = WScript.CreateObject("Shell.Application") objShell.ShellExecute "launcher.exe", "", swtorHome ' create the file that the elevated script will copy swtor's path and commandline to set fso = CreateObject("Scripting.FileSystemObject") set tempfolder = fso.GetSpecialFolder(2) tempname = tempfolder & "\" & "swtorsteam.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", 1 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 swtorExecutablePath = swtorHome + "swtor\retailclient" set tempfile = fso.OpenTextFile(tempname) swtorCommandLine = tempfile.ReadLine tempfile.close() Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "swtor.exe", swtorCommandLine, swtorExecutablePath fso.DeleteFile tempname WScript.Quit Else ' we are elevated now WScript.Echo "Waiting for launcher to start swtor..." 'Get Windows Manager object Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") ' check every second for swtor.exe that was launched by swtor's launcher While True 'Get info on processes named "swtor.exe" Set swtorInstanceList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name =""swtor.exe""") for Each swtorInstance in swtorInstanceList cmdline = swtorInstance.CommandLine 'look for something only our swtor will have in it's commandline arguments If InStr(cmdline, "username") > 0 Then 'we found the swtor.exe we care about swtorInstance.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 End If Next WScript.Sleep 1000 Wend End If

Step 2 (steam):

- Open up steam and go to the menu option "Games" and click "Add a non-steam game to my library"
- Add "Star Wars the Old Republic" or browse to swtor's "launcher.exe" and add that.
- Now right-click the newly added game in steam's library, and click properties.

- Change the properties to match these:

> (Optional) Choose Icon: Browse to swtor's "launcher.exe" and select it

> (Optional) Name: Star Wars - The Old Republic

> (Required) Target: "C:\Windows\System32\cscript.exe" "PUT FULLPATH TO steamswtor.vbs"

> here's a full example (the quotes are important):
Target: "C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic\steamswtor.vbs"

> (Required) Start In(the quotes are important): "C:\Windows\System32"

That's it.

Worked for me :happyleon:
Shuaizu 24 mart. 2017 la 19:15 
Sorry I'm not going to run scripts and risk any game banning me for it.
Bench 24 mart. 2017 la 19:16 
Postat inițial de MissPanda #BoTW:
Sorry I'm not going to run scripts and risk any game banning me for it.

Source: http://www.swtor.com/community/showthread.php?t=94152

17 pages long so it should be pretty safe if you ask me.
Editat ultima dată de Bench; 24 mart. 2017 la 19:17
Shuaizu 24 mart. 2017 la 19:22 
Not risking it (:
Shuaizu 24 mart. 2017 la 19:41 
I already figured it out anyway. All you have to do is run both Steam + SWTOR as administrator and it'll work. No fishy script needed.
mimizukari 24 mart. 2017 la 19:59 
Postat inițial de MissPanda #BoTW:
I already figured it out anyway. All you have to do is run both Steam + SWTOR as administrator and it'll work. No fishy script needed.
it isn't a fishy script, if you can read the coding you can tell all it does is what he said.
S2.Souji 24 nov. 2017 la 17:57 
Postat inițial de Bench:
You can.

Step 1 (script):
copy paste this script into a plain text editor (ex. notepad) and save it as "steamswtor.vbs" in the same directory as your swtor launcher (ex. "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic"):


' if nothing was passed in, we are starting from scratch, so start the launcher If WScript.Arguments.length = 0 Then swtorHome = WScript.ScriptFullName swtorHome = Left(swtorHome, InStr(swtorHome, WScript.ScriptName)-1) 'run the launcher Set objShell = WScript.CreateObject("Shell.Application") objShell.ShellExecute "launcher.exe", "", swtorHome ' create the file that the elevated script will copy swtor's path and commandline to set fso = CreateObject("Scripting.FileSystemObject") set tempfolder = fso.GetSpecialFolder(2) tempname = tempfolder & "\" & "swtorsteam.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", 1 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 swtorExecutablePath = swtorHome + "swtor\retailclient" set tempfile = fso.OpenTextFile(tempname) swtorCommandLine = tempfile.ReadLine tempfile.close() Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "swtor.exe", swtorCommandLine, swtorExecutablePath fso.DeleteFile tempname WScript.Quit Else ' we are elevated now WScript.Echo "Waiting for launcher to start swtor..." 'Get Windows Manager object Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") ' check every second for swtor.exe that was launched by swtor's launcher While True 'Get info on processes named "swtor.exe" Set swtorInstanceList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name =""swtor.exe""") for Each swtorInstance in swtorInstanceList cmdline = swtorInstance.CommandLine 'look for something only our swtor will have in it's commandline arguments If InStr(cmdline, "username") > 0 Then 'we found the swtor.exe we care about swtorInstance.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 End If Next WScript.Sleep 1000 Wend End If

Step 2 (steam):

- Open up steam and go to the menu option "Games" and click "Add a non-steam game to my library"
- Add "Star Wars the Old Republic" or browse to swtor's "launcher.exe" and add that.
- Now right-click the newly added game in steam's library, and click properties.

- Change the properties to match these:

> (Optional) Choose Icon: Browse to swtor's "launcher.exe" and select it

> (Optional) Name: Star Wars - The Old Republic

> (Required) Target: "C:\Windows\System32\cscript.exe" "PUT FULLPATH TO steamswtor.vbs"

> here's a full example (the quotes are important):
Target: "C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic\steamswtor.vbs"

> (Required) Start In(the quotes are important): "C:\Windows\System32"

That's it.

Worked for me :happyleon:


helo. thanks for this. but what should i change in the script if i want to use it for other games? thanks again.
Bench 24 nov. 2017 la 18:14 
Which games do you wanna add?
I have state of decay externally, I would like to as I am using nexus mod manager. i want to be able to click launch in nexus mod manager and it will start with steam as a non steam game
Postat inițial de Bench:
You can.

Step 1 (script):
copy paste this script into a plain text editor (ex. notepad) and save it as "steamswtor.vbs" in the same directory as your swtor launcher (ex. "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic"):


' if nothing was passed in, we are starting from scratch, so start the launcher If WScript.Arguments.length = 0 Then swtorHome = WScript.ScriptFullName swtorHome = Left(swtorHome, InStr(swtorHome, WScript.ScriptName)-1) 'run the launcher Set objShell = WScript.CreateObject("Shell.Application") objShell.ShellExecute "launcher.exe", "", swtorHome ' create the file that the elevated script will copy swtor's path and commandline to set fso = CreateObject("Scripting.FileSystemObject") set tempfolder = fso.GetSpecialFolder(2) tempname = tempfolder & "\" & "swtorsteam.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", 1 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 swtorExecutablePath = swtorHome + "swtor\retailclient" set tempfile = fso.OpenTextFile(tempname) swtorCommandLine = tempfile.ReadLine tempfile.close() Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "swtor.exe", swtorCommandLine, swtorExecutablePath fso.DeleteFile tempname WScript.Quit Else ' we are elevated now WScript.Echo "Waiting for launcher to start swtor..." 'Get Windows Manager object Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") ' check every second for swtor.exe that was launched by swtor's launcher While True 'Get info on processes named "swtor.exe" Set swtorInstanceList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name =""swtor.exe""") for Each swtorInstance in swtorInstanceList cmdline = swtorInstance.CommandLine 'look for something only our swtor will have in it's commandline arguments If InStr(cmdline, "username") > 0 Then 'we found the swtor.exe we care about swtorInstance.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 End If Next WScript.Sleep 1000 Wend End If

Step 2 (steam):

- Open up steam and go to the menu option "Games" and click "Add a non-steam game to my library"
- Add "Star Wars the Old Republic" or browse to swtor's "launcher.exe" and add that.
- Now right-click the newly added game in steam's library, and click properties.

- Change the properties to match these:

> (Optional) Choose Icon: Browse to swtor's "launcher.exe" and select it

> (Optional) Name: Star Wars - The Old Republic

> (Required) Target: "C:\Windows\System32\cscript.exe" "PUT FULLPATH TO steamswtor.vbs"

> here's a full example (the quotes are important):
Target: "C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic\steamswtor.vbs"

> (Required) Start In(the quotes are important): "C:\Windows\System32"

That's it.

Worked for me :happyleon:
its working
Drasuke 17 apr. 2020 la 17:04 
Postat inițial de Bench:
You can.

Step 1 (script):
copy paste this script into a plain text editor (ex. notepad) and save it as "steamswtor.vbs" in the same directory as your swtor launcher (ex. "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic"):


' if nothing was passed in, we are starting from scratch, so start the launcher If WScript.Arguments.length = 0 Then swtorHome = WScript.ScriptFullName swtorHome = Left(swtorHome, InStr(swtorHome, WScript.ScriptName)-1) 'run the launcher Set objShell = WScript.CreateObject("Shell.Application") objShell.ShellExecute "launcher.exe", "", swtorHome ' create the file that the elevated script will copy swtor's path and commandline to set fso = CreateObject("Scripting.FileSystemObject") set tempfolder = fso.GetSpecialFolder(2) tempname = tempfolder & "\" & "swtorsteam.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", 1 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 swtorExecutablePath = swtorHome + "swtor\retailclient" set tempfile = fso.OpenTextFile(tempname) swtorCommandLine = tempfile.ReadLine tempfile.close() Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "swtor.exe", swtorCommandLine, swtorExecutablePath fso.DeleteFile tempname WScript.Quit Else ' we are elevated now WScript.Echo "Waiting for launcher to start swtor..." 'Get Windows Manager object Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") ' check every second for swtor.exe that was launched by swtor's launcher While True 'Get info on processes named "swtor.exe" Set swtorInstanceList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name =""swtor.exe""") for Each swtorInstance in swtorInstanceList cmdline = swtorInstance.CommandLine 'look for something only our swtor will have in it's commandline arguments If InStr(cmdline, "username") > 0 Then 'we found the swtor.exe we care about swtorInstance.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 End If Next WScript.Sleep 1000 Wend End If

Step 2 (steam):

- Open up steam and go to the menu option "Games" and click "Add a non-steam game to my library"
- Add "Star Wars the Old Republic" or browse to swtor's "launcher.exe" and add that.
- Now right-click the newly added game in steam's library, and click properties.

- Change the properties to match these:

> (Optional) Choose Icon: Browse to swtor's "launcher.exe" and select it

> (Optional) Name: Star Wars - The Old Republic

> (Required) Target: "C:\Windows\System32\cscript.exe" "PUT FULLPATH TO steamswtor.vbs"

> here's a full example (the quotes are important):
Target: "C:\Windows\System32\cscript.exe" "C:\Program Files (x86)\Electronic Arts\BioWare\Star Wars - The Old Republic\steamswtor.vbs"

> (Required) Start In(the quotes are important): "C:\Windows\System32"

That's it.

Worked for me :happyleon:
Can some one help to me with this script to work on other game too?
< >
Se afișează 1-12 din 12 comentarii
Per pagină: 1530 50

Toate discuțiile > Forumuri Steam > Help and Tips > Detaliile subiectului
Data postării: 24 mart. 2017 la 18:30
Postări: 12