转载地址:http://blog.csdn.net/hutao1101175783/article/details/42807063  

 

cmd:='echo d | Xcopy '+BasePath+' '+TargetPath+' /s/e';

    i:=ShellExecute(Handle,nil,'cmd.exe',PChar('/K '+cmd),nil,SW_HIDE);

 

ShellExecute(Handle,nil, 'cmd.exe',pchar('/C '+GetCurrentDir+'\build.bat'), nil, SW_HIDE);

 

执行命令前面加“/K”,执行bat文件前面加"/C"

 

还有就是 如果有的CMD命令执行后需要询问再输入参数才能继续执行,echo 参数 |

相关文章:

  • 2021-12-14
  • 2021-12-04
  • 2021-08-07
  • 2022-12-23
  • 2021-08-05
  • 2022-02-02
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2022-01-16
  • 2022-12-23
相关资源
相似解决方案