注意:部分文章发布时间较长,可能存在未知因素,购买时建议在本站搜索商家名称,先充分了解商家动态。
交流:唯一投稿邮箱:hostvps@88.com。
网友 z6045670 说:
文件夹C:\Users\mjj\Desktop\txt\
文件夹里有5个txt文件
要求每隔110秒改名其中某文件名为mjj.txt
5个txt文件循环改
求大佬赐句 感谢
或者其他方式实现此功能就行
网友 **hczzz 说:
不会bat,只会python写。
网友 Salta 说:
不会bat 只会shell nodejs php
网友 好鸭 说:
powershell执行
while(1){
Move-Item mjj.txt (Get-Random+&*uot;.txt&*uot;)
$file=Get-Random -InputObject (ls).name
Move-Item $file mjj.txt
Start-Sleep -s 110
}
网友 z6045670 说:
好鸭 发表于 2022-7-16 14:31
powershell执行
网友 bug**soul 说:
*帖最后由 bug**soul 于 2022-7-16 16:15 编辑
@echo off
cls
setlocal EnableDelayedExpansion
:again
for /r &*uot;C:\Users\mjj\Desktop\txt&*uot; %%a in (*) do (
if /i &*uot;%%~xa&*uot; == &*uot;.txt&*uot; (
set &*uot;fname=%%~na&*uot;
if /i NOT &*uot;!fname:~0,4!&*uot; == &*uot;mjj_&*uot; move /y &*uot;%%~dpnxa&*uot; &*uot;%%~dpamjj_!random!.txt&*uot;
)
)
timeout /t 110
goto again
网友 z6045670 说:
bug**soul 发表于 2022-7-16 16:00
保存扩展名为.cmd或.bat
网友 z6045670 说:
bug**soul 发表于 2022-7-16 16:00
保存扩展名为.cmd或.bat
贝壳主机网

