Playnite Forums
  • Playnite Web
  • Rules
  • Members
  • Team
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Playnite Forums Playnite General swap to steam account before launching game

swap to steam account before launching game
marcspc
Offline

#1
03-01-2020, 08:48 AM
when destiny forced migration to steam had a problem and my account counl't be linked, support said I had to make a new account, so I had to logout my steam, login the new account when I wanted to play destiny
now I have a batch script that does it
playnite can run a batch script on game launch and another on game close
so playnite with that batch script is great for having multiple steam accounts, before launching the game

@echo off

taskkill.exe /F /IM steam.exe
set username="ACCOUNTNAME"
Goto end

:end

reg add "HKCU\Software\Valve\Steam" /v AutoLoginUser /t REG_SZ /d %username% /f
reg add "HKCU\Software\Valve\Steam" /v RememberPassword /t REG_DWORD /d 1 /f
start steam://open/main

exit


and back to the other account when closing
DonkeyOatay
Offline

#2
04-28-2020, 10:18 AM (This post was last modified: 04-28-2020, 12:25 PM by DonkeyOatay.)
Only just been pointed at this - thanks a lot for posting! Very useful.

Now if you can tell me how to do the same with Origin please Smile

Edit: Never mind, worked out how to do Origin myself (it uses a file rather than the registry). If anyone is interested PM me and I will post a how-to.
Crow
Offline

Administrator
#3
04-29-2020, 09:50 AM
(04-28-2020, 10:18 AM)Donkeyfumbler Wrote: Edit: Never mind, worked out how to do Origin myself (it uses a file rather than the registry). If anyone is interested PM me and I will post a how-to.

Can you post solution for Origin as separate thread? I think it would be really useful.
marcspc
Offline

#4
07-04-2020, 10:12 AM
(04-28-2020, 10:18 AM)Donkeyfumbler Wrote: Only just been pointed at this - thanks a lot for posting! Very useful.

Now if you can tell me how to do the same with Origin please Smile

Edit: Never mind, worked out how to do Origin myself (it uses a file rather than the registry). If anyone is interested PM me and I will post a how-to.

I am interested, can you please share it here?
DonkeyOatay
Offline

#5
07-04-2020, 08:58 PM
Sorry - I meant to post this earlier, then posted it in another thread but now realise that it no longer actually works anyway and deleted it again - back to the drawing board!
CriticalComposer
Offline

#6
04-30-2021, 08:19 PM
Does anyone know if Epic could utilize the same workaround, simply changing the registry entries before launching?
DonkeyOatay
Offline

#7
04-30-2021, 09:55 PM
Not taken a look into it, but you do realise that many of the games bought from Epic can be run from the .exe file without having to have the Epic client running (and therefore you don't have to worry about changing accounts)?
CriticalComposer
Offline

#8
05-01-2021, 05:10 AM
I probably have a super fringe case but I use my personal EGS account to play my games. However, every night after my daughter goes to bed I play on her Fortnite account to clean up any daily missions that she didn't do to help her level up her battle pass. So being able to setup a script for an secondary Play Action would simplify this process of logging out/in every night.
darklinkpower
Offline

Super Moderator
#9
11-27-2021, 01:01 AM
For people in Playnite 9, since batch is no longer supported here is a powershell script to do this

$autoLoginUsername = "darklinkpower"

# Only process if current saved username is not the same one
if ($autoLoginUsername -ne (Get-ItemProperty -Path "HKCU:\Software\Valve\Steam" -Name "AutoLoginUser").AutoLoginUser)
{
    if ($null -ne (Get-Process | Where-Object {$_.Name -eq "steam"}))
    {
        # Gracefully shutdown steam if detected as running. Expects default location.
        Start-Process "C:\Program Files (x86)\Steam\steam.exe" "-shutdown"
        Start-Sleep -Milliseconds 1200
    }
   
    Set-ItemProperty -Path "HKCU:\Software\Valve\Steam" -Name "AutoLoginUser" -Value $autoLoginUsername
    Set-ItemProperty -Path "HKCU:\Software\Valve\Steam" -Name "RememberPassword" -Value 1
}
jh0nny2k
Offline

#10
11-29-2021, 03:41 PM (This post was last modified: 12-12-2021, 02:37 PM by jh0nny2k.)
Hi Dark,

Hope you don't mind. I tried your script and it wasn't working. It was launching steam with no password filled in and you had to fill in the password manually. So i changed it up a little bit :

$Username = "YourUsernameHere"
$Password = "YourPasswordHere"

if ($null -ne (Get-Process | Where-Object {$_.Name -eq "steam"}))
{
# Gracefully shutdown steam if detected as running. Expects default location.
Stop-Process -Name steam -Force -ErrorAction SilentlyContinue -PassThru
Start-Sleep -Milliseconds 1200
}

Start-Process -FilePath 'C:\Program Files (x86)\Steam\Steam.exe' -ArgumentList "-login $Username $Password"
jh0nny2k
Offline

#11
12-12-2021, 02:46 PM
Actually Dark's script works better. It just needs a better explaining. Mine works too but his is better because it actually remembers your username and password.

Thing is, after your first run the script it will ask you to input the password. Put it in and then just exit steam. Second time you run it it will just log you in.
SallySunny
Offline

#12
01-04-2022, 08:53 AM
Very useful! Thanks a lot!
o0Julia0o
Offline

#13
03-11-2022, 02:27 PM
The batch-script from marcspc worked a lot of month. But now it´s not working anymore. Everytime i login, i have to fill in my login-data again.
jh0nny2k
Offline

#14
11-03-2022, 01:16 AM
Same here. We might need a better solution. For the moment i'm using TcNO account switcher Smile would love to somehow implement this into playnite or somehow automate it
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode