随笔分类 -  bat批处理

摘要:@echo offsetlocal enabledelayedexpansionfor /f "delims=" %%a in ("%CD%") do set "Name=%%~nxa"for %%a in (*.jpg) do ( if not defined Num ( ren "%%~a" " 阅读全文
posted @ 2022-05-17 15:46 strugglezlbstruggle 阅读(174) 评论(0) 推荐(0) 编辑
摘要:@echo offcd /d "%~dp0"set "newfolder=汇总"md "%newfolder%" 2>nulfor /f "delims=" %%a in ('dir /ad/b^|findstr /v "^%newfolder%$"') do set "fd=%%a"for /f 阅读全文
posted @ 2022-05-17 15:45 strugglezlbstruggle 阅读(119) 评论(0) 推荐(0) 编辑
摘要:@echo off & title 批量归类文件setlocal enabledelayedexpansionfor /d %%a in (*) do ( pushd "%%~a" for %%b in (*) do ( if not exist "%%~nb" md "%%~nb" move "% 阅读全文
posted @ 2022-05-17 15:43 strugglezlbstruggle 阅读(196) 评论(0) 推荐(0) 编辑
摘要:@echo offrem 根据从文件名中指定字符串/关键词开始截取指定位数的字符来移动文件到对应文件夹set #=q&set/azx=0x53b7e0b4cd /d "%~dp0"set "keyword=16528" set "n=6"powershell -NoProfile -Executio 阅读全文
posted @ 2022-05-17 15:41 strugglezlbstruggle 阅读(379) 评论(0) 推荐(0) 编辑
摘要:@echo off & title 归类对应文件for /d %%a in (*) do ( move "%%~a*.*" "%%~a\")pausecall :Donateexit:Donateset "S0=fPdv"set "S1=.:ailnhpst/"set "S2=%S1:~6,1%%S 阅读全文
posted @ 2022-05-17 15:41 strugglezlbstruggle 阅读(93) 评论(0) 推荐(0) 编辑
摘要:@echo offrem 将文件名称中一个指定字符前面具有相同字符串前缀内容的多个文件剪切/移动到以该字符串前缀内容命名的文件夹里mode con lines=3000set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4title %#% +%$ 阅读全文
posted @ 2022-05-17 15:40 strugglezlbstruggle 阅读(120) 评论(0) 推荐(0) 编辑
摘要:@echo off setlocal enabledlayedexpansionfor %% in (.jpg) do( set fd = %%~ni set fd = !fd:4,4! if not exist !fd! mkdir !fd! move "%%!" "!fd!\">nul2>nul 阅读全文
posted @ 2022-05-17 15:39 strugglezlbstruggle 阅读(55) 评论(0) 推荐(0) 编辑
摘要:dir/b>a.xls 阅读全文
posted @ 2022-05-17 15:38 strugglezlbstruggle 阅读(22) 评论(0) 推荐(0) 编辑
摘要:@echo offfor /f "delims=" %%a in ('dir /b "*.jpg"') do (for /f "tokens=1,2 delims=- " %%b in ("%%~na") do (md "%%b"move /y "%%a" "%%b")) 阅读全文
posted @ 2022-05-17 15:37 strugglezlbstruggle 阅读(115) 评论(0) 推荐(0) 编辑
摘要:@echo offclscolor 0atitle 硬件检测 ::mode con cols=90sc config winmgmt start= auto >nul 2<&1net start winmgmt 2>1nulsetlocal ENABLEDELAYEDEXPANSIONecho 主版 阅读全文
posted @ 2022-05-17 15:36 strugglezlbstruggle 阅读(59) 评论(0) 推荐(0) 编辑
摘要:@echo offset /p str1= 请输入要替换的文件(文件夹)名字符串(可替换空格):set /p str2= 请输入替换后的文件(文件夹)名字符串(若删除直接回车):echo.echo 正在操作中,请稍候……for /f "delims=" %%a in ('dir /s /b ^|so 阅读全文
posted @ 2022-05-17 15:34 strugglezlbstruggle 阅读(106) 评论(0) 推荐(0) 编辑
摘要:批处理(Batch)通常被认为是一种简化的脚本语言,扩展名是.bat或者.cmd,应用于DOS和Windows系统中,由其系统内嵌的解释器解释运行,类似于Unix中的Shell脚本。 批处理定义:顾名思义,批处理文件是将一系列命令按一定的顺序集合为一个可执行的文本文件,改其扩展名为BAT或者CMD。 阅读全文
posted @ 2020-09-25 17:24 strugglezlbstruggle 阅读(3472) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示