# Mender-cli subprocess login works on Linux but fails on Windows – workaround?

**URL:** <https://hub.mender.io/t/mender-cli-subprocess-login-works-on-linux-but-fails-on-windows-workaround/7864>\
**Category:** General Discussions\
**Created:** [July 2, 2025, 7:40am UTC](https://hub.mender.io/t/mender-cli-subprocess-login-works-on-linux-but-fails-on-windows-workaround/7864 "2025-07-02T07:40:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakash\_goyal](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@aakash\_goyal](https://hub.mender.io/u/aakash_goyal)\
**Post date:** [July 2, 2025, 7:40am UTC](https://hub.mender.io/t/mender-cli-subprocess-login-works-on-linux-but-fails-on-windows-workaround/7864/1 "2025-07-02T07:40:06Z")

</div>

I’m trying to send data to a remote device using `mender-cli`. It works fine on Linux, but I’m running into issues on Windows since `mender-cli` isn’t officially available there. Is there any workaround or alternative method to get it working on a Windows system?

Here’s the relevant part of my code:

```auto
result = subprocess.run(
    login_cmd,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True,
    check=True
)

```

The `login_cmd` I’m passing looks like this:

```auto
['mender-cli', 'login', '--server', 'https://eu.hosted.mender.io/', '--username', 'a.gl@gmai.com', '--password', 'ABC']

```

This works perfectly on Debian Linux, but fails on Windows.  
How can I get this working on a Windows system?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [July 2, 2025, 8:25am UTC](https://hub.mender.io/t/mender-cli-subprocess-login-works-on-linux-but-fails-on-windows-workaround/7864/2 "2025-07-02T08:25:17Z")

</div>

Hi @aakash_goyal,

The only somewhat promising approach on Windows is probably using the WSL (Windows Subsystem for Linux).

Alternatively you can of course look at the source code ([GitHub - mendersoftware/mender-cli: A general-purpose CLI for the Mender backend](https://github.com/mendersoftware/mender-cli)) and try to either adapt it or extract the relevant parts, or even skip `mender-cli` entirely. In the end, it is just a convenience tool for interacting with the API ([Mender API docs](https://docs.mender.io/api/)), so it might be a viable solution to just use the API directly in your script.

Greetz,  
Josef
