zwift-login

zwift-login is a simple utility which basically lets you launch Zwift without having to click any button or fill any fields in the login sequence of the game.

It can be used to launch Zwift and login directly from the command line, too.

This is how you use it…

See it demonstrated in a screencast by following this link. Otherwise, just try it – it is really simple to use.

Zwift is launched just by pressing Launch Zwift:

Launching Zwift by the press of a button…

Once the password is stored (it will be saved in a file on your harddrive) it only takes a single button press to launch Zwift and feed it your login details if you have not stored them directly in Zwift.

First time a bit of setup is required…

The first step is to store your username and password, so press Store Password (only necessary at first run or if you change your Zwift password).

Now the Launch Zwift button will be enabled. Naturally, you won’t have to save the password again unless you change it in Zwift.

Zwift status and preferences alerts

At the bottom of the window you can see the current Zwift status (from the Zwift status page).

Right above that you will see alerts for certain settings in prefs.xml, which it is good to be aware of before launching Zwift of if you did not intend to have them activated in this session:

  • A world icon will be shown if the world hack is used
  • A full screen icon (looking like an empty frame) will be shown if the Minimal UI-setting is set

It works together with other ZwiftHacks…

zwift-login plays together with some of the other tools here on the site.

zwift-preferences

If the zwift-preferences script is installed in the same folder as zwift-login there will be a button that you can launch it with. That way you can easily make your choice of e.g. trainer resistance level, world and course selection before you launch Zwift.

zwift-hotkeys

If the zwift-hotkeys script is installed in the same folder as zwift-login it will automatically be launched together with Zwift (depending on the option being activated) .

TR-Z-move

If the TR-Z-move script is installed in the same folder as zwift-login it will automatically be launched together with Zwift (depending on the option being activated).

Using as a command line tool

zwift-login accepts a command line parameter (/launch) which makes it launch Zwift automatically with the need for pressing a button. This can be used e.g. for scheduling an unattended start of Zwift.

Run zwift-login.ahk like this:

AutoHotkey.exe zwift-login.ahk /launch

It will launch with the stored settings of the last user selected in zwift-login.

To specify which user (1-5) you can combine /launch with the /user= parameter (see below) or use the short form /launch=1 etc.

AutoHotkey.exe zwift-login.ahk /launch /user=1

or

AutoHotkey.exe zwift-login.ahk /launch=1

To open zwift-login with a specific user selected:

Use one of the parameters /user=1, /user=2, /user=3, /user=4, and /user=5.

Example:

AutoHotkey.exe zwift-login.ahk /user=1

To skip checks for user/password and/or skip Change User step

/nouser When zwift-login is launched with that switch you are allowed to launch Zwift even if no user/password is stored in zwift-login, and zwift-login also just presses Let’s Go if that is the screen the launcher opens with (it skips the Change User step in the launcher which it normally would trigger).

This is intended mostly for specialised scenarios where you use zwift-login for automating the login process. If you use the /nouser and /launch command line switches together zwift-login will simply launch Zwift and press Let’s Go (assuming that the launcher have saved your username and password).

Other command line parameters:

/onlyzwift Will only launch Zwift and not look for any other ZwiftHacks scripts to launch simultaneosly.

/delay Will delay the launch for 10 seconds.

/keepalive Will keep zwift-login running till Zwift is closed (implemented for compatibility with Steam, as suggested and first implemented by Frank Quinn).

Using with non-standard Zwift setups

Even if you have Zwift installed in a location different from the default (which is %ProgramFiles(x86)\Zwift%, typically C:\Program Files (x86)\Zwift) or have the Zwift document\data files in a non-default location (which is Documents\Zwift) you can still use zwift-login if you set up a couple of environment variables: ZWIFTPROG and ZWIFTDOC.

If you have Zwift installed in a location different from the default:

Add an environment variable called ZWIFTPROG to your Windows account to point to your Zwift program folder:

Example: ZWIFTPROG=C:\win10\Zwift

You may have to log out of Windows and log in again after defining it for the environment variable to be known.

After this zwift-login will always use the value of ZWIFTPROG as the location of the Zwift program files instead of the default location.

If you have your Zwift documents (e.g. prefs.xml) in a location different from the default:

If you have your Zwift data files/documents in another folder than the default Documents\Zwift folder you can similarly control where zwift-login and zwift-preferences look for the data files (prefs.xml) with a new ZWIFTDOC environment variable (this is also supported in zwift-preferences).

Google can tell you how to add/modify environment variables:

https://www.google.com/search?q=set+environment+variable+in+windows+10

Prerequisites

Windows PC w/

Downloads

Current version

Download “zwift-login script with installer” setup-zwift-login.exe – Downloaded 23451 times – 1.64 MB

Read more about the installer package.

Older versions

In case you need it, here is the older v32:

zwift-login script with installer

History

73 comments

    1. Download again (I just put a new version up for download). Run zwift-login.ahk like this:

      AutoHotkey.exe zwift-login.ahk /launch

      This version accepts the following parameters:

      /launch
      Launches Zwift
      /onlyzwift
      Will only launch Zwift and not look for any other ZwiftHacks scripts to launch simultaneosly.

  1. Hi, I’m having trouble with this. I’ve downloaded the update and it’s opening the Zwift program fine, but it’s not hitting the ‘Let’s Go’ button.

    1. It may be that it is resolved simply by closing the Zwift launcher (by right clicking the icon in the notification area and choosing exit) because Zwift sometimes end up in a special state after an update. Then Zwift and the Zwift launcher run with elevated rights (as administrator) and does not respond to keypresses and command from another process (zwift-login) which is not elevated itself.

      If this does not help, please let me know and I can look further into it.

      1. Hi Jesper!

        Thanks for the reply and the help – though I confess I haven’t carried it out. I uninstalled everything and then re-installed it and it seems to work now, though I can’t put my finger on what I’ve done differently.

        Thanks for the system you’ve (and anyone else has) put together, it is helpful.

        Jx

  2. How can I use zwift-login if I install Zwift app on a custom path like D:\Zwift

    I found the path dir on row 525-542, but I can’t modify it by myself

    1. You have two options:
      1) Modify the script
      2) Make the standard location for Zwift a symbolic link to your custom location

      Here is how to do it:

      Option 1 – Modify the script

      Open your copy zwift-login.ahk in Notepad and change the script in line 527, 534, and 540 from
      EnvGet, pf, ProgramFiles(x86)
      to
      pf := "D:"

      You can simply use search and replace to make the change.

      Option 2 – Make a symbolic link

      Open a Cmd or Powershell window (as administrator).
      Use mklink to create the link:

      mklink /D "%ProgramFiles(x86)%\Zwift" "d:\zwift"

  3. Hi,
    is it possible to create different shortcuts for different users, f.e. one Desktop Icon that starts login with my account and another icon that starts Zwift with a different account? I’ve already tried to create to versions of the Zwift-login.ahk file which refer to two different ini files, but when I start it from the command line (autohotkey.exe “C:\Users\xyz\Documents\Zwift\Scripts\zwift-login-xyz.ahk” /launch) Zwift always logs in with the latest active account. Is there any solution? Thanks in advance

    1. Yes, it can work. The solution is to never let Zwift remember the user but instead only store usernames and passwords in zwift-login.

      To make Zwift forget the user you can do the following:

      Launch Zwift from the start menu
      In the ‘Welcome!’ screen with the ‘Let’s go’ button press ‘Change user’
      Enter your password, remove the check mark from ‘Remember me’, and press ‘Log in’
      When the ‘Welcome!’ screen appears again, close it by clicking on the X in the top right corner.

  4. Hi,
    the login script doesn`t pass the Sign-in screen any longer. I have to sign in manually; deinstall and reinstall of the script as well as of Auto Hotkey didn`t make things better. Any suggestions appreciated, thanks a lot!

    1. It may be that it is resolved simply by closing the Zwift launcher (by right clicking the icon in the notification area and choosing exit) because Zwift sometimes end up in a special state after an update. Then Zwift and the Zwift launcher run with elevated rights (as administrator) and does not respond to keypresses and command from another process (zwift-login) which is not elevated itself.
      If this does not help, please let me know.

  5. Hi Jesper,
    thanks for the reply; unfortunately closing the Zwift Launcher doesn`t help, I tried this option already as you proposed it a few posts before, but without success. I forgot to mention it in my first request.

    1. If you are using the latest version of zwift-login and has restarted your PC I don’t have a good explanation why it doesn’t work. I just tested it this morning without any problems. I’ll have to think about what you can try next.

  6. I Love this!
    My Zwift takes so long to load once i get into my cave that i often miss events.
    Now i can tell google home to load & login while im still putting on my gear.

    1. No, that hasn’t been built into zwift-login. I’ll take a note of this as a possible new feature (but I won’t promise anything).

  7. I can’t seem to solve an issue with this script, each time after I complete a ride with ‘save and exit’ or ‘discard’ when the zwift window closes, I see the zwift-login ahk window still up and an error message flashes up (see link for screenshot). Any ideas why this might be?

      1. It’s not a problem I have seen before but let’s try to figure out what causes it.

        I have some questions for you:

        1. If you exit Zwift before you run zwift-login (right click the Zwift icon in the systray and click ‘Exit’) is it still the same?
        2. How do you launch zwift-login – from the Windows menu?
        3. Which version of Autohotkey is installed on your PC?
        4. Which version of Windows does your computer have?
        1. Thanks for responding!
          1. I tried this once and it did not have an effect.
          2. I launch it with a desktop shortcut; the program is located in a folder with its ini file etc. on the windows system drive, and the desktop shortcut points to the .ahk file
          3. 1.1.22.2
          4. Windows 10 home

          1. Jesper thanks but after upgrading AHK the same issue persists. I might try to step through the script to debug or reinstall zwift altogether

          2. What it the text in the status bar of zwift-login when the error message appears? Is it ‘Pressing Ride Button…’?
            It will tell me where in the code to look for the problem.

    1. It really should be

      {path to autohotkey.exe} zwift-login.ahk /launch

      unless the directory where autohotkey.exe is installed is already in the PATH variable on your computer.

      You can run this from a shortcut you create, from a bat/cmd file, from the ‘Run’ window (Win+R), from Task Scheduler and in many other ways.

  8. I don’t know much about programming at all. Where is the command line parameter, and where exactly do I put “autohotkey.exe zwift-login-ahk /launch” in the text of “zwift-login-ahk”?

    Thanks

    1. You can always just start zwift-login from the installed shortcut in the Windows Start menu.

      If the talk about command line arguments is nonsense for you then you probably don’t need this advanced feature at all 😉

      The command line usage is definitely what I would call advanced usage. You can run this from a shortcut you create, from a bat/cmd file, from the ‘Run’ window (Win+R), from Task Scheduler and in many other ways if you are into automating things on your computer.

  9. Hi another great tool! I can’t get it to run TR-Zmove when it launches though? All scripts are in scripts folder: trzmove, preferences and login? Any ideas? Thanks!

  10. This is GREAT! Recently, though, I’ve seen a script-error window pop up “between” the zwift script mini-window and the “lets go” window. Eventually that script-error window seems to disappear and things eventually load, but seems to be taking longer than normal. Just noting this as a potential new issue.

    1. You get the same if you launch Zwift manually. It is an error from the Zwift launcher itself. For now just click yes to make it go away.

      There’ll be a new version of zwift-login soon which can dismiss the script error window automatically.

      1. we use it for two accounts, as mentioned in an earlier comment, and now it will remember the previously used login. Somehow the “remember” checkbox is always checked and I do not seem to be able to disable it.

        Worked like a charm before.

        1. You’re right! ‘Remember me’ has changed to checked as default in Zwift Launcher. I’ll release an update to handle it.

  11. Hi. Great idea for a helper script, thanks for putting the effort in to developing it.

    I can’t get the multi-user functionality to work for Zwift running on Windows 10. I’ve registered two users inside zwift-login but, regardless of which user I select before clicking ‘launch zwift’ it just loads Zwift up as the last logged in user. Any suggestions for how to debug?

    Finally, I’d love to be able to execute this remotely from a linux machine using ssh to e.g. launch a Windows scheduled task. Any pointers or suggestions here? Every other aspect of my pain cave is automated – just this bit to fix!

    1. Sounds like Zwift remembers the user, too. You have to start Zwift Launcher, choose ‘Change User’, clear the usename field + untick the ‘Remember me’ box, and attempt to log in. It fails, of course. Then just close the Zwift Launcher.

      Hopefully this helps.

      Read up on the command line switches – I think they will let you do what you are after.

      1. Perfect, thanks Jesper. I’d previously enabled ‘capture usernames and passwords’ in iexplore to make logging in easier.

  12. I set this up two years on one laptop where all it takes is one click of the program to start Zwift. I’ve now put it onto another laptop, but I have to press “Launch Zwift” after clicking on zwift-login. How can I make it so that only need to click on the zwift-login shortcut once in order to get into Zwift?

    1. You must have set up the shortcut on your first laptop to do this, something like “autohotkey.exe zwift-login-ahk /launch” or “zwift-login.exe /launch”. The /launch parameter is what gives the behaviour you would like to have.

      1. Thanks, I was able to figure out that “/launch” needs to be added to properties>shortcut>target when right-clicking on the zwift-login shortcut icon.

        It works, except now it stops at the Change User/Let’s Go screen. How can I get it to automatically press Let’s Go?

        1. It seems that Zwift has just released a new version of their Zwift Launcher – I just learned about it yesterday. You probably have that on your new laptop. It is much improved but I will have to adapt zwift-login to work with it. I will have to do some testing before I release a new version.

          1. Ah, so that explains it. Many thanks for your work on this, it’s a really awesome little program!

  13. Can you explain it to me like I’m five years old? What do I click and what do I type in order to do this?

  14. When I launch the script, the “window” is very small and the dialog boxes are not visible. Suggestions?

  15. It’s all good now! Love this hack – perfect for a “two-zwifter” family!!

  16. Hello,
    Brilliant idea.

    I’m not sure if this is the expected behavior, but why does the sequence “always” involve pressing the “Change User” button? And is there any way where I can skip that?

    I’m the only user of Zwift.

    My expectation is a single shortcut click, that would automatically “/launch” zwift and takes me straight away to the pairing screen.

    Thank you very much.

    1. The sequence always include Change User because it made the internal logic much easier and saves a lot of troubleshooting in scenarios with multiple users of the same Zwift setup.

      You can skip it adding the /nouser switch to the start menu shortcut to zwift-login. In your case you could also add /launch – then it will be a fully automated launch of Zwift when you start zwift-login.

      I just added the description of /nouser to this page (it was in the latest release notes).

      1. Excellent. I think that solved it for me. (The bottom of the screen still shows “Loading login screen” and “Filling fields”. Just an FYI). Thank you very much.

  17. Hey Jesper,
    I just wanted to say thank you for the awesome work you’ve put in to these tools. It’s really very much appreciated!
    Cheers!
    Matt.

  18. Came here for those like me trying to get zwift running with Steam link in Steam big picture.
    I tried adding zwift to steam, and launching it remotely, however it didnt work with the launcher screen.
    Grabbed Jespers program and the other pre reqs. installed them, ticked the leave running for steam setting, add the zwiftlogin +launch to steam.
    Hey Presto! it works now, boots up easily and runs much smoother on the streaming PC.
    Trainer is connected via the phone, along with HR monitor.

    Thanks

    Jesper

  19. Thank you so much for your work!
    I would like to have the possibility to manage 30 user logins, but currently, I can only see the option to use 5 users maximum.
    Thank you for your kind reply!

    1. It would require some changes to the zwift-login.script but is doable for anyone with just a tiny bit of coding skills (see guidance below).

      You have to be aware that the passwords are not securely saved, so I would not recommend using zwift-login in a public setting where one user potentially could find the passwords of other users.

      The changes needed are:

      Line 133: Change
      Loop, 5 {
      to
      Loop, 30 {

      After line 229:
      Add additional lines for the values 6-30 like this:
      Gui, Add, Radio, xp+30 yp gRadioSlot5, 6
      et cetera.

      Line 760: Change
      Loop, 5
      to
      Loop, 30

      Line 895: Add extra blocks for each of the value 6-30 like this:
      RadioSlot5:
      Slot := 6
      SaveSlotToIni()
      LoadFromIni()
      SetGuiInitialState()
      Return

      Line 760: Change
      Loop, 5
      to
      Loop, 30

Leave a Reply

Your email address will not be published. Required fields are marked *