无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 3139|回复: 7
打印 上一主题 下一主题

批处理问题,请教

[复制链接]
跳转到指定楼层
1#
发表于 2002-4-14 01:53:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
对了,问你一个问题,
我用dir /b /s *.gho 可以查初当前目录下所以子目录下的*.gho
当批处理dir查出hwy.gho在当前的bin目录下
我是否可以设个差数能自动进到那个目录,
该怎样写批处理??
帮帮我,谢谢!!
2#
 楼主| 发表于 2002-4-14 01:57:04 | 只看该作者

批处理问题,请教

我用:
for %%1 in (dir /s /b *.gho) do set ghof=%%1
只能查出*.gho 文件!
不知怎么进入那个目录!!
  
回复

使用道具 举报

3#
发表于 2002-4-14 10:34:08 | 只看该作者

批处理问题,请教

再加一条
cd %%1
行不行啊
回复

使用道具 举报

4#
发表于 2002-4-19 15:15:49 | 只看该作者

批处理问题,请教

[UploadFile=2_3199_3.rar]@echo off
rem 找当前目录(根目录)的*.txt
for %%a in (*.txt) do type %%a
rem 以下为找当前目录(根目录)的所有子目录下的所有*.txt
set i=1
set j=1
set filenum=0
set dirnum=0
varset root=FULL of . >temp.bat
call temp.bat
varset rootdir=string(3) %root% >temp.bat
call temp.bat
dir /ad /b /s >temp.txt
varset dirnum=lines temp.txt >temp.bat
call temp.bat
:loop1
type %root%\temp.txt | %root%\LMOD /L%i% set curdir=[] >%root%\temp.bat
call %root%\temp.bat
varset curdir=string(3) %curdir% >%root%\temp.bat
call %root%\temp.bat
cd %curdir%
echo %curdir%
set j=1
:loop2
        %root%\varset filenum=files *.txt >%root%\temp.bat
        call %root%\temp.bat
        if %filenum%==0 goto end2
        dir *.txt /b | %root%\LMOD /L%j% set curfile=[] >%root%\temp.bat
        call %root%\temp.bat
        type %curfile%
        if %j%==%filenum% goto end2
        %root%\varset j=%j%+1 >%root%\temp.bat
        call %root%\temp.bat
        goto loop2        
:end2
cd %rootdir%
if %i%==%dirnum% goto end1
%root%\varset i=%i%+1 >%root%\temp.bat
call %root%\temp.bat
goto loop1
:end1
del %root%\temp.bat
del %root%\temp.txt
set i=
set j=
set filenum=
set dirnum=
set root=
set rootdir=
set curdir=
set curfile=
回复

使用道具 举报

5#
发表于 2002-4-19 15:24:50 | 只看该作者

批处理问题,请教

太专业
回复

使用道具 举报

6#
发表于 2002-4-19 15:30:13 | 只看该作者

批处理问题,请教

This is called "Professional"!
回复

使用道具 举报

7#
发表于 2002-4-19 15:41:42 | 只看该作者

批处理问题,请教

我不懂This is called "Professional"!
回复

使用道具 举报

8#
发表于 2002-4-19 16:28:21 | 只看该作者

批处理问题,请教

其实这个涉及到了数据结构中的树的遍历算法!不知道这里有没有人学过数据结构?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-12-17 19:25

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表