本帖最后由 pcl_test 于 2015-5-23 23:53 编辑
- @echo off
- for /l %%a in (1 1 10) do (
- >$ echo;%%a
- copy $+"测试.txt" temp >nul
- move temp "测试.txt" >nul
- )
- del $
- pause
复制代码
- @echo off
- for /l %%a in (1 1 10) do (
- >$ type "测试.txt" 2>nul
- >"测试.txt" echo;%%a
- >>"测试.txt" type $
- )
- del $
- pause
复制代码
- @echo off & setlocal enabledelayedexpansion
- set n=1000
- for /l %%a in (1 1 10) do set /a n+=1&set #!n!=%%a
- (for /f "tokens=2 delims==" %%b in ('set #^|sort /r') do echo;%%b)>>"测试.txt"
- pause
复制代码
|