mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 10:41:52 -05:00
Core Utils
This commit is contained in:
parent
cb080862d5
commit
fd9b6b65ff
2 changed files with 33 additions and 2 deletions
BIN
ShiftOS.zip
BIN
ShiftOS.zip
Binary file not shown.
|
@ -1615,13 +1615,44 @@ public void cmd_default(String[] args)
|
||||||
}
|
}
|
||||||
if (done == false)
|
if (done == false)
|
||||||
{
|
{
|
||||||
// Lua Executer By Carver Harrison (@carverh)
|
// This runs LUA and EXE Applications
|
||||||
|
// Created By Carver Harrison (@carverh)
|
||||||
if (File.Exists("C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua"))
|
if (File.Exists("C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua"))
|
||||||
{
|
{
|
||||||
String lp = "C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua";
|
string lp = "C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua";
|
||||||
WriteLine(lp);
|
WriteLine(lp);
|
||||||
var l = new LuaInterpreter(lp);
|
var l = new LuaInterpreter(lp);
|
||||||
}
|
}
|
||||||
|
else if (File.Exists("C:\\ShiftOS\\bin\\" + args[0] + ".exe"))
|
||||||
|
{
|
||||||
|
bool isFirstArg = true;
|
||||||
|
string exeArgs = "";
|
||||||
|
foreach (string arg in args)
|
||||||
|
{
|
||||||
|
if (!isFirstArg)
|
||||||
|
{
|
||||||
|
exeArgs = exeArgs + " " + arg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isFirstArg = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string lp = "C:\\ShiftOS\\bin\\" + args[0] + ".exe";
|
||||||
|
Process p = new Process();
|
||||||
|
p.StartInfo.Arguments = exeArgs;
|
||||||
|
p.StartInfo.UseShellExecute = false;
|
||||||
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
|
p.StartInfo.FileName = lp;
|
||||||
|
p.StartInfo.CreateNoWindow = true;
|
||||||
|
p.StartInfo.ErrorDialog = false;
|
||||||
|
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||||
|
p.StartInfo.WorkingDirectory = current_dir;
|
||||||
|
p.Start();
|
||||||
|
|
||||||
|
WriteLine(p.StandardOutput.ReadToEnd());
|
||||||
|
p.WaitForExit();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wrongcommand();
|
wrongcommand();
|
||||||
|
|
Loading…
Reference in a new issue