下面代码,是我组装的电脑是win7系统,每次执行都提醒我语法错误,不知道到底错在哪里?
另外,这个代码能在win10执行么?没电脑测试(后期也需要拿到win10系统用)。大神指点时候 求帮忙也看看,感谢了!研究到半夜 也没研究明白。。。。- @echo off
- chcp 936
- type 保存.txt > newfile.txt
- cmd /c "type newfile.txt > 2.txt && del newfile.txt"
- copy /y /b 2.txt %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%提取链接备份.txt
- findstr "https://www.baidu.com" 2.txt > 3.txt
- @echo off
- (for /f "delims=" %%a in ('type "3.txt"') do if not defined %%a (echo,%%a &set %%a=def))>"4.txt"
- @echo off
- @echo off
- cd.>tmp.txt
- for /f "delims=" %%i in ('findstr /n .* 4.txt') do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- set "str=!str:*:=!"
- >>tmp.txt echo !random!:!str!
- endlocal
- )
- cd.>等待.txt
- for /f "delims=" %%i in ('sort tmp.txt') do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- set "str=!str:*:=!"
- >>等待.txt echo.!str!
- endlocal
- )
- del tmp.txt
- del 2.txt
- del 3.txtdel 4.txt
- del 保存.txt
- start 等待.txt
复制代码
|