C# 执行bat

作者:雨辰 发布于:2017-9-22 11:30 Friday 分类:DOS

 Process proc = null;
        try
        {
            string targetDir = Application.dataPath.Substring(0, Application.dataPath.IndexOf("Assets"));
            proc = new Process();
            proc.StartInfo.FileName = targetDir + "bundle_run_copy.bat";
            proc.StartInfo.Arguments = string.Format("10");//this is argument
            proc.StartInfo.CreateNoWindow = false;
            proc.Start();
            proc.WaitForExit();
        }
        catch (System.Exception ex)
        {
            UnityEngine.Debug.LogError(string.Format("Exception Occurred :{0},{1}", ex.Message, ex.StackTrace.ToString()));
        }

标签: Unity3D-Editer DOS

发表评论:

雨辰 joyimp|@2011-2017 京ICP备16030765号