While working on one of recent projects, I've stumbled upon few common issues that many meet - even if you are only targeting Windows in GameMaker: Studio, you cannot access files outside the game's AppData directory (not even in program directory). Neither you can order system to open a file, meaning no external "readmes" to be easily hooked up with game, nor portable configuration files, and some other limitations.
So I took an evening and made a simplistic DLL library to bring equivalents to some functions (sleep, execute_shell, non-sandboxed I/O) back for Windows target. Function list is as following:
Identical to pre-Studio sleep(ms) routine. Pauses game execution for given number of milliseconds. For example,
Will pause game execution for 2.5 seconds.
Orders system to do specified action to given file. Common ones are "open", "edit", "print", and availability may vary depending on file type and system configuration.
Identical to execute_shell. You can also use this to open programs with arguments.
shell_execute_at(file, args, directory)
Similar to shell_execute, but you also get to specify working directory for program (or file) ran. This can be useful, if you want to use external tools without specifying absolute paths or having to store them in root of game folder.
Retrieves contents of text file located at given absolute path (no sandboxing) as string. If file does not exist, or an error occurs while retrieving the contents, an empty string is returned.
Replaces contents of file at given path (no sandboxing) with ones provided. If file does not exist, it will be created. Returns, whether the operation was successful.
A more or less precise replica of get_color function from older versions of GameMaker.
A non-sandboxed function for copying files. Note: Uses absolute paths!
In addition, the example attached demonstrates usage of most of these functions.
January 23, 2016:
Fixed the issue with file handles not being closed automatically.
The example is now distributed as ZIP to circumvent problems with importing.
Source code is now included in the download and is available separately.
Removed shell_open due to inconsistent behavior on some systems - use shell_do("open", path) instead. Added get_color_win, window_set_caption_ext, file_copy_win.
February 12, 2016:
The DLL no longer requires Visual C++ Runtime to function.
Should help if it previously didn't work for you.