Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
510 views
in Technique[技术] by (71.8m points)

exe - How do you run an executable on multiple folders?

  • I need to run an executable on multiple folders. Lets say the EXECUTABLE is called "example.exe".
  • The group of folders are DATED sub-directories that use a scheme of 20140101-20141231. A year of dated sub-directories. 365 Folders in total.
  • I usually run the command like: d:FOLDER1FOLDER2EXECUTABLESexample.exe /DATE 20140101

The problem w/ this method is that I am ONLY able to run this executable on ONE dated sub-directory or folder at a time...any help would be appreciated! Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Directly from the prompt,

for /d %a in (d:yoursubdirectory2014*) do d:FOLDER1FOLDER2EXECUTABLESexample.exe /DATE %%~na

or

for /d %a in (d:yoursubdirectory2014*) do call d:FOLDER1FOLDER2EXECUTABLESexample.exe /DATE %%~na

or

for /d %a in (d:yoursubdirectory2014*) do start /w "" d:FOLDER1FOLDER2EXECUTABLESexample.exe /DATE %%~na

may suit.

(I've assumed you want the parameter following the /date switch to be the name of the directory; also 2014* assumes you want this to run on all directories named starting 2014.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...