Shuaizu Mar 24, 2017 @ 6:30pm
[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.
Last edited by Shuaizu; Mar 24, 2017 @ 8:03pm
< >
Showing 1-12 of 12 comments
mimizukari Mar 24, 2017 @ 6:30pm 
you can't, unless it just works, like it did for some games like anarchy online(on steam now tho)
Last edited by mimizukari; Mar 24, 2017 @ 6:30pm
Bench Mar 24, 2017 @ 7:02pm 
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 Mar 24, 2017 @ 7:15pm 
Sorry I'm not going to run scripts and risk any game banning me for it.
Bench Mar 24, 2017 @ 7:16pm 
Originally posted by 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.
Last edited by Bench; Mar 24, 2017 @ 7:17pm
Shuaizu Mar 24, 2017 @ 7:22pm 
Not risking it (:
Shuaizu Mar 24, 2017 @ 7:41pm 
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 Mar 24, 2017 @ 7:59pm 
Originally posted by 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 Nov 24, 2017 @ 5:57pm 
Originally posted by 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 Nov 24, 2017 @ 6:14pm 
Which games do you wanna add?
Quarren King of Q Jul 10, 2018 @ 6:09pm 
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
Originally posted by 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 Apr 17, 2020 @ 5:04pm 
Originally posted by 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?
< >
Showing 1-12 of 12 comments
Per page: 1530 50

Date Posted: Mar 24, 2017 @ 6:30pm
Posts: 12