A downloadable extension

Download NowName your own price

Quick links: source code · GM Marketplace page

This single-function extension allows to call ShellExecute from GameMaker: Studio and GameMaker Studio 2 games.

The function execute_shell_simple takes up to 4 arguments:

  • path (required)
    The absolute path to whatever you are trying to run - an executable, a text file, a .url, etc.
    If you are not sure how to get the true path to your file, have the game copy it to save directory (game_save_id).
  • args (optional)
    Command-line arguments to pass. Non-executables will generally ignore these.
    If omitted, defaults to "".
  • action (optional)
    What to do with the file, as per lpOperation in MSDN.
    If omitted, defaults to "open".
  • showCmd (optional)
    One or other magic number (such as 6 for SW_MINIMIZE) from the same MSDN page.
    If omitted, defaults to 5 (SW_SHOW).


Create a text file and open it in default editor:

var _path = game_save_id + "/hi.txt";
var _txt = file_text_open_write(_path);
file_text_write_string(_txt, "Hi! " + date_datetime_string(date_current_datetime()));

Create a text file and open it in Notepad:

var _path = game_save_id + "/hi.txt";
var _txt = file_text_open_write(_path);
file_text_write_string(_txt, "Hi! " + date_datetime_string(date_current_datetime()));
var _windir = environment_get_variable("WINDIR");
execute_shell_simple(_windir + "/Notepad.exe", _path);

Create an internet shortcut and open it in default browser:

var _url = "https://yoyogames.com";
var _path = game_save_id + "/shortcut.url";
var _txt = file_text_open_write(_path);
// note: use '' instead of @'' in GMS1
file_text_write_string(_txt, @'[{000214A0-0000-0000-C000-000000000046}]
URL=' + _url);

For more advanced uses, consider Execute Shell or Evaluate Shell by Samuel Venable.

Rated 5.0 out of 5 stars
(7 total ratings)


Download NowName your own price

Click download now to get access to the following files:

execute_shell_simple_ext-for-GMS1.gmez 4 kB
Version 1.1
execute_shell_simple_ext-for-GMS2.yymp 7 kB
Version 1.1
execute_shell_simple_ext-for-GMS2.3+.yymps 8 kB
Version 1.1

Development log


Log in with itch.io to leave a comment.

The extension doesn't work when you execute a gamemaker game that was compiled in V2023.8.0.98 and after, but if you use any gamemaker game that was compiled in the past, will work with the extension.

Given the symptoms, I guess GameMaker games now require a more convoluted way to launch them, for some reason.

Unfortunately I think a recent gamemaker update might have broke this...  It's ceased working for me as of IDE v2023.8.0.98, Runtime 2023.8.0.145

Tried my test project from GitHub and seems to work fine

¯\_(ツ)_/¯ I reverted the version back to 2023.6.0.92 and it's working just fine again.   Couldn't say what's happening exactly.

For reference, I'm using the extention to open multiple windows of my game similar to a tutorial I found somewhere:

if( global.multiStart ){
    var i;
    for(i=3; i<=global.multiStartInstances+3; i++){
        if (parameter_count() == i) {
            if( i < global.multiStartInstances+2 ){
                var k;
                var paramStr = parameter_string(1)+" ";
                for(k=2; k<=i; k++){
                    paramStr += parameter_string(k)+" ";
                paramStr += "-secondary";
            var pNum = i-3;
            var xPos = pNum%2;
            var yPos = floor(pNum/2);
                    100 + (global.resolutionX + 40)*xPos,
                    60 + (global.resolutionY + 60)*yPos);
            global.onlinePortNumber = 32770+i;//different ports for each game
            global.connectIp = "";
            global.connectPort = 32790;

Basically just restarting the game with more and more parameters and opening windows based on how many parameters there are.

Could this be used to open GM Live? When I put the full path to the .exe, nothing happened. 

I also tried looking at xProcess but there wasn't any documentation and I couldn't really understand the example project from a glance. 


When using a full path with backslashes, make sure to put it inside a @"strings" string since backslashes have a different meaning in regular "strings". This worked for me


Thank you, that worked perfectly!

This is pretty great. But is there a way to execute the command in background, without opening the prompt?

You’ll probably want Samuel’s xProcess for that

Hello! Sorry this just might be me being new and not understanding this, but how would i go about having game maker use this to open vbs files? (The vbs file in question is just to have a custom windows error message popup. telling you incase this type of file affects how you code it in B) Thanks in advance!!!

IIRC you’re supposed to feed them to ...\System32\WScript.exe. Or maybe CScript.exe.

Does this not allow for BAT files to be called?

Per description, it’s a very literal wrapper around a WinAPI function. You might have to feed the .bat file to cmd.exe, or use a different action - chances are that you are not the first person on the internet to try running a .bat file through ShellExecute.

Oh man, I feel silly haha.  Thanks!

Hello. Can opening a URL be perceived by antiviruses as a virus? In the manual, the command "url_open" may be perceived as a virus


It’s probably the act of asking the browser to open a URL that might get blocked by an antivirus.

Thank you for making this extension. I was wondering why the URL started with %22 and I'm glad that this was the first page I came across to fix the problem.

I've been making a game for 9.5 years with game Game Maker 1.4999 now, and I'm almost ready to upload a demo. I realized the URL thing stopped working. I was going to use it to refer people to my Patreon page.

For future reference, I would recommend that you give an example on how to use the function after installing. I had to scroll through the comments and found someone said:


I am happy that I fixed the problem, but now I am even more happy that people like you are still keeping Game Maker 1.4 still relevant.

(1 edit)

Thank you. There’s an Examples section in the itch description.

Worked like a charm!  Thanks so much for making this! :)

I downloaded the x64 version from the link above, but it doesn't work. It says "Variable <unknown_object>.execute_shell_simple_ext(102244, -2147483648) not set before reading it". Do I miss something? Thank you.

(The 32bit version worked fine for an year).

(1 edit)

You are using the extension name instead of the function name. As to how this worked before, is beyond me.

Oh sorry, my fault. now it works fine. Thank you for the help, and thank you for the work you do!


you saved my life with this extension man, I'm paying for it, thank you for sharing it for free!

(1 edit)

Hello. This works great in Windows, but less so in HTML5. Is it not HTML5 compatible, perhaps?

I copy and pasted your example for opening a webpage directly for testing. No matter what I do, I get this error:

Uncaught ReferenceError: execute_shell_simple_raw is not defined

I downloaded your GMS2.3+ version yesterday, so it's definitely not outdated.

(1 edit)

You’ll want either url_open[_ext] or clickable_* on HTML5 - an extension can’t do much more than the runtime already does.

Thanks for the response. I got it working with what you suggested.


Thank you, this helped to solve a problem I was having with opening URLs. For anyone here to be able to crack open a web link, just do;


It would be amazing if there was execute shell for android. Would definitely pay in the marketplace for an android execute shell like function.

Is your intention to open a file or launch another application?

I was thinking about launching an apk file or opening another file as well with a function (script) similar to execute shell.

Could you explain to me how to simply open a webpage with this? in GM 1.4

See the “Create an internet shortcut and open it in default browser:” right in the itch.io page description

Do I have to create the shortcut first? Or can i just run a command to open a webpage?

The snippet creates a shortcut and then opens it, as the title says. Paste it into some keyboard press event and see what happens

(1 edit)

I found if i just used execute_shell_simple("url") it worked :)

Can you make it work for Android?

That requires a complete rewrite and investigating how and whether that could be done on Android, so probably not.

Thanks for this! Really comes in handy. I have however noticed that it doesn't seem to work on some computers.

When I launch my game I'm checking for an update, if there is one I download the updated version to the working_directory. When the .exe is downloaded I run it with your script. Work flawlessly on two of my computers, but for some reason it doesn't on the last one I tried it on 🤔

I don't know if you have any idea why?

Anyways, thanks for making this! 😀

It is possible that your executable gets confiscated by an antivirus program for the duration of scan - try with something simpler like a .txt file first.

i get the execute_shell_simple_raw thing and not the original function, for some reason the examples dont work

I don’t know how you have accomplished this since I checked and both the extension and the sample project have the DLL + GML files.

I'm having the same issue. Downloaded the YYMP, then imported it into my project as a local package. execute_shell shows up as a constant and execute_shell_simple_raw shows up as a function. Nothing happens when running execute_shell_simple_raw


I released a new version that renames the extension to not be the same name as its main function


Thank you for this! :D

(1 edit)

Hey YAL, love your stuff. (question about transition to Windows 64)

If you are using the new 64-bit Windows runtime, you should be aware that it breaks every single existing DLL. I wouldn’t recommend using it unless you are confident that every extension you use can be updated.

As for my extensions in particular, a quick search shows that I have dozens of ones that use DLLs, and many of them have not been migrated to GMS2 (instead relying on compatibility scripts), so it will take a while to update all of them.

If it is extremely urgent, you may attempt to compile extensions yourself using the source code that is either included with the extension (for paid extensions) or linked on the extension page (for free extensions), though code changes may be required for - argument and return types vary 32-bit to 64-bit for many system functions.

(2 edits)

I'm kind of in a bind. Releasing a large update for my project on the 25th, and the 64x stops some memory allocation issues people were having, but I also don't want to lose your mouse_lock stuff :L

How would I go about compiling it myself, I don't know what the heck I'm doing with extensions?

If this is not something I could realistically do quickly on my own, no worries.

Good stuff

Thank you!