close

使用shellExecute 執行BAT命令

1. 第二個參數呼叫cmd.exe

2. 第三個參數要 /C 加BAT命令 ex: 'shutdown -r -t 0' or 'xcopy c:/1.txt d:/1.txt /D/K/E/Y/C/I'

3. 第四個參數執行目錄

 

範例
    ShellExecute(handle, 'open','cmd.exe', PChar('/C ' + CmdStr), Pchar(exedirpath), SW_SHOW);
    

arrow
arrow
    文章標籤
    shellapi bat
    全站熱搜

    抓狂小白 發表在 痞客邦 留言(0) 人氣()