在shell中有很多种命令的同义词,到底先执行的是哪一个命令呢,我们可以借助type -a命令来检查. 为了测试我们就对type本身做一条alias: alias type=type 然后我们通过type -a type查看一下,结果如下: type -a type type is aliased to `type' type is a shell builtin type is /usr/bin/type 可以清楚地看到,对于命令来说首先执行的是alias,然后是shell内嵌的命令,最后才是
把要执行的cmd命令放入一个bat文件里,然后执行: //Process p = Process.Start(bPath); Process pro = new Process();pro.StartInfo.FileName = bPath;pro.StartInfo.CreateNoWindow = true;pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;pro.Start();