iT邦幫忙

1

批次檔要如何撰寫??

我想寫一個 bat 檔 能夠執行 D:\dpsys 中每一個目錄裡的 clsdate.exe 1次 請問要如何做??
https://ithelp.ithome.com.tw/upload/images/20190822/20112688IB9unuRP8k.png
https://ithelp.ithome.com.tw/upload/images/20190822/20112688fgt4Y8Xgsr.png

slime iT邦大師 1 級 ‧ 2019-08-22 11:22:00 檢舉
FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]

在樹狀目錄中切換 [drive:] 路徑,並於樹狀目錄的每
一個目錄下執行 FOR 陳述式。如果未在 /R 之後指定
目錄規格,則採用目前的目錄。如果 set 只是單一句
點 (.) 字元,則它只會列舉樹狀目錄。
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

11
dragonH
iT邦超人 5 級 ‧ 2019-08-22 11:00:10
最佳解答

img

@echo off
for /d %%i in (D:\demo\190823\*) do ( cd "%%i" &  call index.bat )
cd ..
看更多先前的回應...收起先前的回應...
雷伊 iT邦高手 1 級 ‧ 2019-08-22 11:12:51 檢舉

你神人膩?

dragonH iT邦超人 5 級 ‧ 2019-08-22 11:18:55 檢舉

這個大家都會啦 有沒有空 跟 想不想回而已 XD/images/emoticon/emoticon50.gif

高手一級

jeffhtw iT邦新手 5 級 ‧ 2019-08-22 11:25:33 檢舉

感恩~~~(受小弟一拜)
因為每次業務外出要將軟體做延期(過期會無法使用) 實在是點到有點抓狂了......

dragonH iT邦超人 5 級 ‧ 2019-08-22 11:33:22 檢舉

... 我還沒貼 code 怎麼就給最佳解了

我只是想測試是不是又是丟了問題就消失的發問XD

看來是我誤會了 /images/emoticon/emoticon48.gif

原文補上我的寫法

小成 iT邦高手 10 級 ‧ 2019-08-22 16:09:06 檢舉

圖會動耶XD,很有心XD

dragonH iT邦超人 5 級 ‧ 2019-08-22 16:19:29 檢舉

/images/emoticon/emoticon82.gif

jeffhtw iT邦新手 5 級 ‧ 2019-09-11 13:44:16 檢舉

哈~ 因為我已經知道了~~~~

我要發表回答

立即登入回答