2

Steam is installed on our home Windows 7 computer. Originally we shared my husband's account. At first it worked just fine whether we opened the games in my user account or his. About a year ago, clicking on the shortcut in my user account would open the games in his user account if he was logged in - I would hear the music, but nothing showed up on my screen or in Task Manager. I'd have to log him out, in which case Steam would open in my user account, or just play from his user account.

Recently, I got my own Steam account. Now if I manage to log in on Steam as me, Steam will subsequently open in my user account, even from the shortcuts on my husband's account. And if he is the last person to log on, Steam only opens in his account.

IF we remember to EXIT (merely logging off of Steam doesn't work), then Steam will load in our own accounts and allow us to log in. But this only works if my husband remembers to actually exit out. It's cumbersome to log in as him and fix Steam for myself, and he has a bad habit of randomly changing his password without telling me.

So, what I need is a method where I can, if need be, shut down a Steam running on another Windows user account so I can log in as me. Preferably I'd like something that can just be bundled into the startup shortcut, like the -login %u %p command.

  • If by shortcuts you mean icons on the Windows desktop or in the the start menu, try launching your games from the Steam client directly. – user86571 Oct 13 '14 at 7:07
  • I also mean the shortcut to the Steam client. And it doesn't matter whether I use the desktop Steam client shortcut or hunt down the direct file steam.exe; it doesn't work if another user is logged in. – CountessQ Oct 13 '14 at 14:18
2

You can use Windows 7's Startup folder to open Steam to the right account when you log in.


What you would want to do is open your Start Menu. There should be a folder called Startup.
Start Menu

Every time you log in, Windows will automatically start all the programs in this folder. So, we can put a Steam shortcut with the %u and %p command-line options.

How to do it?

This presumes your Steam executable is in C:\Program Files (x86)\Steam\Steam.exe
You'll have to repeat these steps for every account you want to do this to.

  1. Open C:\Users\[PC Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs.
  2. Right click and create a new folder. Call it Startup (Capital S).
  3. Now, go into that folder and right click. Go to New > Create New Shortcut.
  4. Now enter "C:\Program Files (x86)\Steam\Steam.exe" -login [username] [password].
  5. Click "Next" and customize the name to your liking (or just leave it as "Steam").

Then repeat on your husband account, but this time, replace [username] and [password] with his username and password, and replace the [PC Username] with your husband's computer username.


You MUST be an administrator of the computer to do this:
Alternatively, if you both are logged in (ie. You're using as the active user, but he's logged in, but just stasis; not using; Switched users back to the login screen).

You'll have to manually stop the Steam process.

  1. Press Win-R and type taskmgr (or press Ctrl-Alt-Delete and click "Start Task Manager")
  2. If Task Manager is not already in administrator mode, click the "Show all Processes" button. If a prompt for admin password or administrator access comes up (UAC; User Access Control), just allow it.
  3. Task Manager should close and reopen with that button gone and more items in the list.
  4. Look for "Steam.exe" in that list. If it doesn't appear, it's most likely that you have not run Task Manager in administrator mode.
  5. Select it and click "End Process"
  6. Click "Ok" to close it.
  7. NOW you can open Steam, but you may have to log him out first.

Alternatively, you can do it with one command: Win-R and enter taskkill /f /im steam.exe. Make sure taskkill.exe is run with administrative privileges as it needs to be able to close programs that are run by a different user.


Steam opening in another Windows User account | No. 7892142's comment
I'm at work right now, I'll try to come up with something up when I get home. (And can test it properly on my own Steam install, I wouldn't want to accidently run it as Admin and open a whole new can of worms.) -- For clarification: The script should kill your husband's Steam and run it with the %u %p command for you?

Instead of creating a shortcut in the "Startup" folder, you could create a batch (.bat) script that kills Steam and reopens it.

taskkill /f /im steam.exe
"C:\Program Files (x86)\Steam\Steam.exe" -login [username] [password]

.bat scripts can be edited using notepad.
(Right click the .bat file and go to Open With... > Notepad)
Say 'OK' to any prompts that come up. It should then open in notepad, or any text editor you have chosen.

Save your batch file in the same folder as the shortcut. You may remove the shortcut if you need.

  • That last paragraph makes me think a two-line batch script (which you would then run as admin) killing Steam and then booting it again properly should do the trick. – No. 7892142 Oct 13 '14 at 13:47
  • No. 7892142, do say on. How would I craft such a command? – CountessQ Oct 13 '14 at 14:21
  • Aytimothy, I don't particularly want to auto-run Steam when I log in, and it's not going to work if my husband is already logged in. Your task manager solution does the trick, but it's a tad cumbersome. Is there any way to craft a simple script and link it to the shortcut, or make it it's own shortcut? I'm not sure my husband will remember all the Task Manager steps in the event that I forget to log out. – CountessQ Oct 13 '14 at 14:25
  • I'm at work right now, I'll try to come up with something up when I get home. (And can test it properly on my own Steam install, I wouldn't want to accidently run it as Admin and open a whole new can of worms.) -- For clarification: The script should kill your husband's Steam and run it with the %u %p command for you? – No. 7892142 Oct 13 '14 at 14:25
  • Edited and added to answers. – aytimothy Oct 13 '14 at 22:54
0
taskkill /f /im steam.exe
start "" "X:\Path\To\Steam.exe" -login %uname %pass

Save to Steam.bat, run as admin. This should just about do the trick? (Please double-check from the Task Manager that Steam is actually run NOT as Admin. Shouldn't, though.)

It's really just Aytimothy's answer with a program start added to it.

  • I never deal with batch files, so I don't know much about them. Are you suggesting I create a steam.bat, or that it actually exists now? I also don't know how to run something as an admin compared to not running it as an admin. DH and I both have admin privileges on our user accounts - is that enough? – CountessQ Oct 13 '14 at 16:13
  • Oh, sorry. You will have to create a file ending with .bat just anywhere. Just like you would create a normal text file. .. As for running as admin, right click on the file you created and pick that option. – No. 7892142 Oct 13 '14 at 16:17
0

Here's a simple way to turn your shortcut into something that kills the old one and starts a new process.

  1. Right click on your shortcut and select properties
  2. Copy and paste the following into the Target field:
    cmd /k taskkill /f /im steam.exe & start steam.exe & exit
    (Windows may change the cmd at the beginning, that is ok)
    • If you are having issues, you may want to try changing the second steam.exe to the full path of your steam install. Usually on Windows this would be either "C:\Program Files\Steam\Steam.exe" or "C:\Program Files (x86)\Steam\Steam.exe" depending on if you are on the 32bit or 64bit version.
  3. Towards the bottom of this dialog is an Advanced button, click it and check "Run as administrator"
  4. Optional: If you want your icon to remain the same, you can click the Change Icon button and navigate to the steam.exe file and select that. It should turn it back into the steam icon
  5. Hit apply and you're good to go

What this does is it adds a the kill command to the beginning of your shortcut so that it will first kill any other versions of steam. If no other versions are running, it will just start steam. Warning, this will kill Steam no matter who is running it, so you shouldn't use this to open steam if it is already running. Instead, click on the icon in your tray.

Your options should look like this: Shortcut dialog

  • Ooh, that's good. Now, can I combine it with the -login %u %p option, and how? Would it work to type cmd /k taskkill /f /im steam.exe & start steam.exe -login %u %p & exit in the target box? ETA: seems it would. Thanks! – CountessQ Oct 13 '14 at 18:04
  • Hmmm. It will only kill the program if it's run as admin, but it will only open Steam if it's NOT run as admin. Shame, that. – CountessQ Oct 13 '14 at 18:22
  • @CountessQ Really? Do you get any errors or anything if you remove the & exit at the end? My steam runs without issue as admin – LoveAndCoding Oct 13 '14 at 18:29
  • Yep. Even without &exit, I get "Windows cannot find 'steam.exe'" if I run it as admin. – CountessQ Oct 13 '14 at 19:32
  • @CountessQ Ah, it must be running it in a different location. Instead of start steam.exe try either start "C:\Program Files\Steam\Steam.exe" (32bit Windows) or start "C:\Program Files (x86)\Steam\Steam.exe" (64bit Windows). You can also copy the value in the Start In field and just add \Steam.exe to the end before the quote character. Trying that should let you run it in admin mode. – LoveAndCoding Oct 13 '14 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.