[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 右键新建一个省点事的批处理 没人带盐 很多缺碘

本帖最后由 smss 于 2020-6-9 15:13 编辑
  1. @Echo off&mode con cols=15 lines=2&color 0d&if not exist %SystemRoot%\批处理.bat color 0b&goto setup
  2. reg delete "HKCR\Directory\Background\shell\New" /f>nul&del /f /q %SystemRoot%\批处理.bat>nul&echo 卸除完毕!&ping 0 -n "2">nul&exit
  3. :setup
  4. reg add "HKCR\Directory\Background\shell\New" /f /ve /t REG_SZ /d "新建批处理(&B)">nul
  5. reg add "HKCR\Directory\Background\shell\New" /f /v "Icon" /t REG_EXPAND_SZ /d "SHELL32.dll,71">nul
  6. reg add "HKCR\Directory\Background\shell\New\command" /t REG_SZ /d "\"%SystemRoot%\批处理.bat\"" /f>nul
  7. (echo SetLocal EnableDelayedExpansion
  8. echo if %%time:~0,2%% lss 10 (set time=!time:~1,1!!time:~3,2!!time:~6,2!^)else set time=!time:~0,2!!time:~3,2!!time:~6,2!
  9. echo (echo @Echo off^^^&SetLocal EnableDelayedExpansion^^^&set n=0
  10. echo echo for /r A文件 %%%%%%%%a in (*.txt^^^)do copy "%%%%%%%%b" "%%%%%%%%a"
  11. echo echo pause
  12. echo echo for /l %%%%%%%%i in (1,3,99999999^^^) do set #%%%%%%%%i=1
  13. echo echo (for /f "delims=" %%%%%%%%i in (1.txt^^^) do set /a n+=1^^^&if defined #^^^^^!n^^^^^! echo "%%%%%%%%i"^^^)^^^>2.txt
  14. echo echo pause^)^>"%%~dp1!date:~0,4!!date:~5,2!!date:~8,2!!time!.bat")>"%SystemRoot%\批处理.bat"
  15. echo 安装完毕!&ping 0 -n "2">nul&exit
复制代码

标准写法应该是这样的,注意文件和文件夹后边的扩展取值
  1. /d "\""%%"SystemRoot"%%"\System32\cmd.exe\" /s /c @echo off&for /f \"delims=\" %%%%z in (\"%%v\")do (Echo,@Echo Off^&Color 0e&Echo,EndLocal&Echo,SetLocal&Echo,rem,SetLocal DisableExtension&Echo,rem,SetLocal EnableExtension&Echo,SetLocal DisableDelayedExpansion&Echo,SetLocal EnableDelayedExpansion&echo,&echo,call:调用标签 调用参数&echo,for /f \"usebackq skip=0 eol=; tokens=* delims= \" %%%%%%%%i in ^('\"\"'^)do ^(&echo, &echo,^)&echo/&echo,pause&echo,goto:eof)>\"%%~fz\Data_"%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%"]["%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%""%%%%"Random:~-1"%%%%".bat\"" /f
复制代码
这么好的论坛你上哪找,运行测试环境为6.1.7601-64
注:请遵守互联网信息安全,勿用于非法用途

TOP

返回列表