批处理文件和文件夹子文件夹随机重命名
1个回答
展开全部
@echo
off
&
setlocal
EnableDelayedExpansion
cd.>record.txt
set
"ReName1=yuitysdoyu412341vbn24efg1251dA1241423aaffiyuiyuiyu23DA45hijfd5441mSGSaD24A"
set
"ReName2=SD453uiy241o12vaauiyuiasdpqdtuvw12wsDAGAASFASdxyuz1fdhsdgqzcASuFSuyuyu3"
set
"ReName3=564afas5vfabvnsirawCDASaui54d4qDSDAauixyuiyyyuVSD56G4S56D12CDASE5F4AS6C"
set
"ReName4=qwecf54811asfaasfASDGFAsadfasgfwehg26a58sa6v9snetjufh6a7ks6g596ASgq5f6Y7K"
pushd
这里是文件夹路径。路径中有空格加引号。
for
/f
"tokens=*
delims="
%%a
in
('dir
/b
/s^|sort
/r')
do
call
:Makename
"%%a"
popd
echo
All
Done...
pause
&
exit
:Makename
setlocal
for
/l
%%i
in
(1
1
4)
do
(
for
/l
%%j
in
(1
1
4)
do
(
set
/a
n=!random!%%70
call
set
"str=!str!%%ReName%%j:~!n!,1%%"
))
for
%%x
in
("%~1")
do
echo
%%~dpx!str!
=
%~1
>>
..\record.txt
ren
"%~1"
!str!
endlocal
==============================
还原的话没细写。挺累了。望采纳。反正是可以做到的。
@echo
off
echo
有几层文件夹就运行几遍。默认无数遍。
If
not
exist
"Record.txt"
echo
Record.txt
does
not
exist
&
pause
&
exit
echo
Read
Record.txt...
for
/f
"tokens=1,2
delims=="
%%i
in
(record.txt)
do
ren
"%%i"
"%%j"
Echo
All
Done...
%0
off
&
setlocal
EnableDelayedExpansion
cd.>record.txt
set
"ReName1=yuitysdoyu412341vbn24efg1251dA1241423aaffiyuiyuiyu23DA45hijfd5441mSGSaD24A"
set
"ReName2=SD453uiy241o12vaauiyuiasdpqdtuvw12wsDAGAASFASdxyuz1fdhsdgqzcASuFSuyuyu3"
set
"ReName3=564afas5vfabvnsirawCDASaui54d4qDSDAauixyuiyyyuVSD56G4S56D12CDASE5F4AS6C"
set
"ReName4=qwecf54811asfaasfASDGFAsadfasgfwehg26a58sa6v9snetjufh6a7ks6g596ASgq5f6Y7K"
pushd
这里是文件夹路径。路径中有空格加引号。
for
/f
"tokens=*
delims="
%%a
in
('dir
/b
/s^|sort
/r')
do
call
:Makename
"%%a"
popd
echo
All
Done...
pause
&
exit
:Makename
setlocal
for
/l
%%i
in
(1
1
4)
do
(
for
/l
%%j
in
(1
1
4)
do
(
set
/a
n=!random!%%70
call
set
"str=!str!%%ReName%%j:~!n!,1%%"
))
for
%%x
in
("%~1")
do
echo
%%~dpx!str!
=
%~1
>>
..\record.txt
ren
"%~1"
!str!
endlocal
==============================
还原的话没细写。挺累了。望采纳。反正是可以做到的。
@echo
off
echo
有几层文件夹就运行几遍。默认无数遍。
If
not
exist
"Record.txt"
echo
Record.txt
does
not
exist
&
pause
&
exit
echo
Read
Record.txt...
for
/f
"tokens=1,2
delims=="
%%i
in
(record.txt)
do
ren
"%%i"
"%%j"
Echo
All
Done...
%0
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询