本帖最后由 jellyhk 于 2011-12-17 16:55 编辑
我郁闷!浪费了我8个小时终于搞定了!算来算去数字光错!头疼!
楼主你要这样的代码有什么用哦!貌似没什么吧!- @echo off
- setlocal enabledelayedexpansion
- set /p n=输入要复制的本数:
- set c=0
- for /f "delims=" %%a in ('dir /a-d /s /b a\*.*') do (set /a c+=1)
- set /a b=c-n
- :l
- for /f "delims=" %%a in ('dir /ad /s /b b\*') do (
- set a=0
- for /f "delims=" %%b in ('dir /a-d /s /b a\*.*') do (
- set /a a+=1
- if !a! gtr !b! move "%%b" "%%a"
- if !a! == !c! set /a c-=n&set /a b-=n
- )
- )
- dir /a-d /s /b a\*.*
- if errorlevel == 1 (exit) else (goto l)
复制代码 =====================我简化了下- @echo off
- setlocal enabledelayedexpansion
- set /p n=输入要复制的本数:
- :l
- for /f "delims=" %%a in ('dir /ad /s /b b\*') do (
- set a=0
- for /f "delims=" %%b in ('dir /a-d /s /b a\*.*') do (
- set /a a+=1
- if !a! leq !n! move "%%b" "%%a"
- )
- )
- dir /a-d /s /b a\*.*
- if errorlevel == 1 (exit) else (goto l)
复制代码
|