diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index d9cdf5581..3cadae176 100644
--- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
+++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
@@ -29,6 +29,12 @@ namespace Flow.Launcher.Plugin
///
void RestartApp();
+ ///
+ /// Run a shell command or external program
+ ///
+ /// The command or program to run
+ void ShellRun(string cmd);
+
///
/// Save everything, all of Flow Launcher and plugins' data and settings
///
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index 6f995671d..c528b8229 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -103,6 +103,16 @@ namespace Flow.Launcher
});
}
+ public void ShellRun(string cmd)
+ {
+ System.Diagnostics.Process process = new();
+ var startInfo = process.StartInfo;
+ startInfo.FileName = "cmd.exe";
+ startInfo.Arguments = $"/C {cmd}";
+ startInfo.CreateNoWindow = true;
+ process.Start();
+ }
+
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
public void StopLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Collapsed;