How to launch remote desktop from perspective view (system.util.execute permissions?)

I’m trying to make a button that launches a remote desktop session to one of our servers.
This command works in the Script Console: system.util.execute(["mstsc", "-v:hostname"])
It launches Remote Desktop and immediately ask for login credentials to that server.

However, when i put this code into a button, it does nothing… (both in designer preview and browser). My best guess is that it has something to do with what browsers are permitted to do etc., but I’m really not sure.

Does anyone know why the command works in the script console but not in the browser?
And if so, is there any way to make this work?

I would try to run that command in the gateway, because Perspective scripts run in the gateway service. (Even if you run your browser in the server, the gateway service won’t have access to the desktop.)

And no, browsers do not permit you to run any code locally outside the browser.

You may want to look into Guacamole by Apache.
It turns remote desktop sessions into web pages and may provide the functionality you are looking for.