2023-09-28 13:15:29 +02:00
|
|
|
function shellOpenExplorer(path) {
|
|
|
|
var _windir = environment_get_variable("WINDIR") + "/explorer.exe";
|
|
|
|
path = string_replace_all(path, "/", "\\");
|
2023-11-03 14:43:28 +01:00
|
|
|
shell_execute_async(_windir, path);
|
2023-09-28 13:15:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function shell_execute(path, command, ref = noone) {
|
|
|
|
gml_pragma("forceinline");
|
|
|
|
|
|
|
|
var txt = $"{path} {command}";
|
|
|
|
|
|
|
|
try {
|
2023-11-03 14:43:28 +01:00
|
|
|
var res = ProcessExecute(txt);
|
|
|
|
//if(global.PROC_ID == 0) noti_status("Execute shell complete", THEME.noti_icon_console,, ref);
|
2023-09-28 13:15:29 +02:00
|
|
|
} catch(e) {
|
2023-11-03 14:43:28 +01:00
|
|
|
//if(global.PROC_ID == 0) noti_warning($"Execute shell failed: {e}", THEME.noti_icon_console_failed, ref);
|
2023-09-28 13:15:29 +02:00
|
|
|
}
|
2023-11-03 14:43:28 +01:00
|
|
|
|
|
|
|
return res;
|
2023-11-01 08:10:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function shell_execute_async(path, command, ref = noone) {
|
|
|
|
gml_pragma("forceinline");
|
|
|
|
|
|
|
|
var txt = $"{path} {command}";
|
|
|
|
|
|
|
|
try {
|
|
|
|
var res = ProcessExecuteAsync(txt);
|
2023-11-03 14:43:28 +01:00
|
|
|
//if(global.PROC_ID == 0) noti_status("Execute shell complete", THEME.noti_icon_console,, ref);
|
2023-11-01 08:10:25 +01:00
|
|
|
} catch(e) {
|
2023-11-03 14:43:28 +01:00
|
|
|
//if(global.PROC_ID == 0) noti_warning($"Execute shell failed: {e}", THEME.noti_icon_console_failed, ref);
|
2023-11-01 08:10:25 +01:00
|
|
|
}
|
2023-11-03 14:43:28 +01:00
|
|
|
|
|
|
|
return res;
|
2023-09-28 13:15:29 +02:00
|
|
|
}
|