Exemplo n.º 1
0
        public bool Process(string[] args)
        {
            if (args[0].Equals("?") || args[0].Equals("help"))
            {
                Help();
                return(true);
            }

            if (args[0].Equals("run") && args.Length > 1)
            {
                var app = args[1];

                var param = "";

                if (args.Length > 2)
                {
                    param = string.Join(" ", args.Skip(2));
                }

                var code = ProcessHandler.Run(app, param, true);
                Log.Entry(LogName, "--> Return code = " + code);

                return(true);
            }

            if (args[0].Equals("runexe") && args.Length > 1)
            {
                var app = args[1];

                var param = "";

                if (args.Length > 2)
                {
                    param = string.Join(" ", args.Skip(2));
                }

                ProcessHandler.RunEXE(app, param, true);
                return(true);
            }

            if (args[0].Equals("runexe") && args.Length > 1)
            {
                var app = args[1];

                var param = "";

                if (args.Length > 2)
                {
                    param = string.Join(" ", args.Skip(2));
                }

                ProcessHandler.RunEXE(app, param, true);
                return(true);
            }

            if (args[0].Equals("runclient") && args.Length > 1)
            {
                var app = args[1];

                var param = "";

                if (args.Length > 2)
                {
                    param = string.Join(" ", args.Skip(2));
                }

                ProcessHandler.RunClientEXE(app, param, true);
                return(true);
            }

            if (args[0].Equals("kill") && args.Length > 1)
            {
                ProcessHandler.Kill(args[1]);
                return(true);
            }

            if (args[0].Equals("killexe") && args.Length > 1)
            {
                ProcessHandler.KillEXE(args[1]);
                return(true);
            }

            if (args[0].Equals("killall") && args.Length > 1)
            {
                ProcessHandler.KillAll(args[1]);
                return(true);
            }

            if (args[0].Equals("killallexe") && args.Length > 1)
            {
                ProcessHandler.KillAllEXE(args[1]);
                return(true);
            }

            return(false);
        }