开发者

Dos Script(BAT) - Print Directory path only when it match certain pattern

I am very new to Dos Script, however I have a task on hand which I believe will be most efficient to execute in Dos Scipt(.BAT).

I will run this BAT file in Window XP Professional

Currently I have a Drive let's say B: Drive which consists of 30 folders and 100,000+ sub folders(not files)

Within the drive there are more than ten thousand job folder and each with a job number

I need to print out a list of all folders that consist of a job number

The job number pattern (imagine the job number is A1234567 with the first char always an alphabet and the follow by 6 - 7 numeric character then a space and the job name

e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls

Unfortunately this job number maybe in different level

e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls

e.g B:/Lv1/B5678214 xxxxx/Lv3/Lv4/xxx.xls

e.g B:/Lv1/Lv2/Lv3/Lv4/Z0425673 xxxxx/Lv5/Lv6/xxx.doc

Lets say if we start from the top and once the sciprt find the job number, it wont continue to drill down to another l开发者_JS百科evel from that folder.

So the outcome will be like this

e.g B:/Lv1/Lv2/A1234567 xxxxx

e.g B:/Lv1/B5678214 xxxxx

e.g B:/Lv1/Lv2/Lv3/Lv4/Z0425673 xxxxx


Do you mean:

e.g B:\Lv1\Lv2\A1234567 xxxxx\Lv4\Lv5\xxx.xls

instead of:

e.g B:/Lv1/Lv2/A1234567 xxxxx/Lv4/Lv5/xxx.xls

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜