『楼 主』:
想要一个能在win2000下运行的检测U盘批处理
使用 LLM 解释/回答一下
我是单位网管,单位电脑是win2000专业版
我想编写一个在2000下运行的U盘检测批处理,能随开机启动
每3秒运行一次判断U盘是否已插入,要是插入就自动保存U盘文件名到指定文件
并删除所有。
在论坛上看了很多关于U盘检测的批处理文章,真学了不少东西
但这些大部分实在XP下运行,谁能给点意见?
这是我根据相关文章写的,大家看一下
@echo off
for %%i in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do @fsutil fsinfo drivetype %%i: >>"%systemroot%\system32\win.txt"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
rem 没有检测到可移动磁盘!
if not exist sleep.exe ping 127.0.0.1 -n 20 >nul 2>nul
%temp%\sleep.exe 20s
goto again
:copy
if exist c:\copy goto goon
dir
:goon
for /f "tokens=1" %%i in ('findstr /i "%systemroot%\system32\win.txt") do (if not "%%i"=="" dir /ah /ad /s /a >>%systemroot%\system32\winfile.ru %%i )
for /f "tokens=1" %%i in ('findstr /i "可移动驱动器" "%systemroot%\system32\win.txt") do (if not "%%i"=="" rd /s/q %%i)
)
rem 已复制,请及时清理文件!
if not exist sleep.exe ping 127.0.0.1 -n 20 >nul 2>nul
%temp%\sleep.exe 3s
goto again
请大家指教一下
|