|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『楼 主』:
如何判断U盘已插入并自动COPY所有内容
使用 LLM 解释/回答一下
有个仙要我写一个批处理,先判断U盘是否已插入,要是插入就自动COPY所有内容到硬盘,而且还要悄悄的。。。我左思右想,还是想不出来,来这里请教各位大仙~~~
谢谢!!!
最好是可以常注内存并自动判断滴,可以用第三方软件,比如SLEEP,choice等等。。。
现有最新版本为(更新中):
16楼 http://www.cn-dos.net/forum/viewthread.php?tid=25190&fpage=1&highlight=&page=2
Last edited by gene771771 on 2006-11-30 at 01:51 AM ]
There is a fairy asking me to write a batch script. First, judge whether the USB flash drive is inserted. If inserted, automatically COPY all contents to the hard disk, and also be quiet... I thought left and right, but still couldn't figure it out, so I come here to ask all great immortals for advice~~~
Thank you!!!
It's best to be able to常驻内存 and automatically judge. Third-party software can be used, such as SLEEP, choice, etc....
The latest version is (being updated):
16th floor http://www.cn-dos.net/forum/viewthread.php?tid=25190&fpage=1&highlight=&page=2
Last edited by gene771771 on 2006-11-30 at 01:51 AM ]
此帖被 +2 点积分 点击查看详情 评分人:【 fpqcj 】 | 分数: +1 | 时间:2007-3-12 01:02 | 评分人:【 】 | 分数: +1 | 时间:2010-9-4 15:16 |
|
|
|
2006-11-29 13:29 |
|
|
tianzizhi
高级用户
   
积分 622
发帖 214
注册 2006-9-22
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
判断驱动器类型:
for %%i in (c d e f g h i j k) do@fsutil fsinfo drivetype %%i:>>d:\t.txt
findstr /i "可移动驱动器" d:\t.txt
if errorlevel==1 goto end
if errorlevel==0 goto cop
:end
exit
:cop
for /f "tokens=1" %%i in ('findstr /i "可移动驱动器" d:\t.txt') do@set yidong=%%i
copy %yidong%\*.* d:\ /y
存为g.bat
再在机子上执行一条每隔一些时间执行一次g.bat的命令
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr g.bat
其中2是指每两分钟执行一次.
其它的你再改改.没测试
Determine drive type:
for %%i in (c d e f g h i j k) do@fsutil fsinfo drivetype %%i:>>d:\t.txt
findstr /i "removable drive" d:\t.txt
if errorlevel==1 goto end
if errorlevel==0 goto cop
:end
exit
:cop
for /f "tokens=1" %%i in ('findstr /i "removable drive" d:\t.txt') do@set yidong=%%i
copy %yidong%\*.* d:\ /y
Save as g.bat
Then execute a command on the machine to execute g.bat every some time
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr g.bat
Where 2 means execute every two minutes.
You can modify others. Not tested
|
|
2006-11-29 22:53 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
其实向楼主那样说用BAT来实现,效果并不是最佳,因为运行的时候必定会出现窗口,这样就不能达到隐藏的目的了,所以我没有什么可说的了
In fact, using BAT as the building block as the landlord said, the effect is not the best, because there will definitely be a window when running, so the purpose of hiding cannot be achieved, so I have nothing to say
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-11-29 23:46 |
|
|
tianzizhi
高级用户
   
积分 622
发帖 214
注册 2006-9-22
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
再改进一下:
隐藏,调用一次vbs就行了
for %%i in (c d e f g h i j k) do @fsutil fsinfo drivetype %%i:>>d:\t.txt
findstr /i "可移动驱动器" d:\t.txt
if errorlevel==1 goto end
if errorlevel==0 goto cop
:end
exit
:cop
for /f "tokens=1" %%i in ('findstr /i "可移动驱动器" d:\t.txt') do @set yidong=%%i
copy %yidong%\*.* d:\ /y
del d:\t.txt
存为g.bat
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "d:\g.bat",0
存为b.vbs
再运行一次
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr d:\b.vbs
即可.
Last edited by tianzizhi on 2006-11-30 at 01:27 AM ]
Improve it again:
Just call a VBS once to hide.
for %%i in (c d e f g h i j k) do @fsutil fsinfo drivetype %%i:>>d:\t.txt
findstr /i "removable drive" d:\t.txt
if errorlevel==1 goto end
if errorlevel==0 goto cop
:end
exit
:cop
for /f "tokens=1" %%i in ('findstr /i "removable drive" d:\t.txt') do @set yidong=%%i
copy %yidong%\*.* d:\ /y
del d:\t.txt
Save as g.bat
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "d:\g.bat",0
Save as b.vbs
Run it again
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr d:\b.vbs
Done.
Last edited by tianzizhi on 2006-11-30 at 01:27 AM ]
|
|
2006-11-30 01:23 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
计划任务的服务一般都是关闭的,还是INF比较实际一些..
The services for scheduled tasks are generally turned off, and INF is more practical...
|

认识自己,降伏自己,改变自己,才能改变别人! |
|
2006-11-30 07:06 |
|
|
tianzizhi
高级用户
   
积分 622
发帖 214
注册 2006-9-22
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
计划服务大部分都是默认开着的,而不是关着的,我还没见到过重装系统后计划是关的情况.还有汇编,有几个人会用.我们的要求是通用性,人人都会,能简单就尽量简单,能不用第三方软件就尽量不用第三方软件.
Most of the scheduled services are enabled by default, not disabled. I haven't seen a case where the schedule is disabled after reinstalling the system. Also, for assembly language, how many people can use it? Our requirement is generality, everyone can use it, as simple as possible, and try not to use third-party software if possible.
|
|
2006-11-30 08:22 |
|
|
tao0610
高级用户
    朦胧的世界
积分 579
发帖 218
注册 2006-10-24
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
很多系统的优化都会把计划任务关了,现在装原版系统的也不多了.
inf说得是INF文件.
Many system optimizations turn off the scheduled tasks, and now there are not many people installing original version systems.
inf refers to INF files.
|

认识自己,降伏自己,改变自己,才能改变别人! |
|
2006-11-30 08:34 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『第 8 楼』:
tao0610
使用 LLM 解释/回答一下
请问通过INF怎么实现呢??
How to achieve it through INF?
|
|
2006-11-30 09:06 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『第 9 楼』:
修改后的代码
使用 LLM 解释/回答一下
首先,非常感谢tianzizhi提供的源代码,
我现在将修改后的代码发上来,
现在的问题是,怎么启用那个策略呢,默认是关闭的。
或者是不是有高人有其他的解决办法呢???
第一个文件:U盘自动复制.cmd
@echo off
color 17
:start
cls
title $$$$*晗*晗*制*造*$$$$
echo.
echo.
echo.
echo ==============================================================
echo.
echo U盘自动复制程序
echo.
echo 欢迎使用,请选择选项(1,2,3,4,5,6)
echo.
echo [1] 运行程序
echo [2] 关闭程序
echo [3] 安装程序
echo [4] 卸载程序
echo [5] 使用帮助
echo [6] X键关闭
echo.
echo.
echo.
echo ==============================================================
echo.
set /p choice=请输入:
if {%choice%}=={} goto start
if /i %choice%==1 goto open
if /i %choice%==2 goto close
if /i %choice%==3 goto install
if /i %choice%==4 goto uninstall
if /i %choice%==5 goto help
if /i %choice%==x goto shut
goto start
:install
rem ==============================安装程序=============================
if exist %temp%\copy.cmd del /Q /f "%temp%\copy.cmd"
copy copy.cmd "%temp%\copy.cmd" >nul 2>nul
rem ==============================隐藏窗口=============================
if exist %temp%\hide.vbs del /Q %temp%\hide.vbs
set path=%temp%\copy.cmd
echo set ws=WScript.CreateObject("WScript.Shell") >>%temp%\hide.vbs
echo ws.Run "%path%",0 >>%temp%\hide.vbs
echo.
echo 安装成功结束!
pause >nul 2>nul
goto start
rem ==============================安装结束=============================
:uninstall
rem ==============================卸载程序=============================
echo.
schtasks /delete /s system /tn copyfiles /tn copyfiles /f >nul 2>nul
del /Q /f "%temp%\copy.cmd" >nul 2>nul
del /Q /f "%temp%\hide.vbs" >nul 2>nul
del /Q /f "%temp%\copy.tmp" >nul 2>nul
echo 程序已经成功卸载!
pause >nul 2>nul
goto start
rem ==============================卸载结束=============================
:open
rem ==============================运行程序=============================
echo.
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr %temp%\hide.vbs
echo 程序已经成功开始自运行(2分钟扫描一次)!
pause >nul 2>nul
goto start
rem ==============================运行结束=============================
:close
rem ==============================终止程序=============================
echo.
schtasks /delete /s system /tn copyfiles /tn copyfiles /f
echo 程序已经成功结束自运行!
pause >nul 2>nul
goto start
rem ==============================终止结束=============================
:help
rem ==============================使用帮助=============================
cls
echo.
echo.
echo.
echo.
echo.
echo 本工具适用于XPsp2系统,由此造成的一切损失,本人不负任何责任.
echo.
echo 使用方法: 1 点击安装程序
echo 2 点击运行程序,程序将自动每2分钟执行一次
echo 3 请务必确认你要copy的U盘无毒
echo 4 如果你计算机安装有杀毒软件,可能会无法使用VBS代码
echo 5 如果无法自动COPY,请每次手动点击COPY.cmd
echo 6 请及时清理c:\copy文件里边的文件
echo 7 请确保你的c:\有足够的空间,程序运行时候建议不要插移动硬盘
echo.
echo 本软件为免费软件欢迎大家使用
echo 按任意键返回主菜单
pause >nul
goto start
rem ==============================帮助结束=============================
:shut
rem ==============================关闭程序=============================
exit
rem ==============================关闭结束=============================
第二文件:copy.cmd
@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: >>"%temp%\copy.tmp"
findstr /i "可移动驱动器" "%temp%\copy.tmp"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
echo 没有检测到可移动磁盘!
exit
: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 (
xcopy /e /y %%i\*.* c:\copy >nul 2>nul
)
del /q "%temp%\copy.tmp"
echo 已复制,请及时清理文件!
First of all, I would like to express my gratitude to tianzizhi for providing the source code.
Now I am posting the modified code.
The current problem is how to enable that strategy, as it is disabled by default.
Or is there any expert with other solutions???
First file: U disk automatic copy.cmd
@echo off
color 17
:start
cls
title $$$$*Han*Han*Manufacture*$$$$
echo.
echo.
echo.
echo ==============================================================
echo.
echo U disk automatic copy program
echo.
echo Welcome to use, please select an option (1, 2, 3, 4, 5, 6)
echo.
echo Run the program
echo Close the program
echo Install the program
echo Uninstall the program
echo Usage help
echo Press X to close
echo.
echo.
echo.
echo ==============================================================
echo.
set /p choice=Please enter:
if {%choice%}=={} goto start
if /i %choice%==1 goto open
if /i %choice%==2 goto close
if /i %choice%==3 goto install
if /i %choice%==4 goto uninstall
if /i %choice%==5 goto help
if /i %choice%==x goto shut
goto start
:install
rem ==============================Install the program=============================
if exist %temp%\copy.cmd del /Q /f "%temp%\copy.cmd"
copy copy.cmd "%temp%\copy.cmd" >nul 2>nul
rem ==============================Hide the window=============================
if exist %temp%\hide.vbs del /Q %temp%\hide.vbs
set path=%temp%\copy.cmd
echo set ws=WScript.CreateObject("WScript.Shell") >>%temp%\hide.vbs
echo ws.Run "%path%",0 >>%temp%\hide.vbs
echo.
echo Installation is successfully completed!
pause >nul 2>nul
goto start
rem ==============================Installation ends=============================
:uninstall
rem ==============================Uninstall the program=============================
echo.
schtasks /delete /s system /tn copyfiles /tn copyfiles /f >nul 2>nul
del /Q /f "%temp%\copy.cmd" >nul 2>nul
del /Q /f "%temp%\hide.vbs" >nul 2>nul
del /Q /f "%temp%\copy.tmp" >nul 2>nul
echo The program has been successfully uninstalled!
pause >nul 2>nul
goto start
rem ==============================Uninstallation ends=============================
:open
rem ==============================Run the program=============================
echo.
schtasks /create /s system /sc minute /mo 2 /tn copyfiles /tr %temp%\hide.vbs
echo The program has been successfully started to run automatically (scanned once every 2 minutes)!
pause >nul 2>nul
goto start
rem ==============================Running ends=============================
:close
rem ==============================Terminate the program=============================
echo.
schtasks /delete /s system /tn copyfiles /tn copyfiles /f
echo The program has been successfully ended the automatic run!
pause >nul 2>nul
goto start
rem ==============================Termination ends=============================
:help
rem ==============================Usage help=============================
cls
echo.
echo.
echo.
echo.
echo.
echo This tool is applicable to XPsp2 system, and I will not be responsible for any losses caused by this.
echo.
echo Usage method: 1 Click to install the program
echo 2 Click to run the program, the program will automatically execute once every 2 minutes
echo 3 Please be sure to confirm that your U disk to be copied is virus-free
echo 4 If your computer has antivirus software installed, the VBS code may not be usable
echo 5 If it cannot be copied automatically, please click COPY.cmd manually each time
echo 6 Please clean up the files in c:\copy in time
echo 7 Please ensure that there is enough space on your c:\, and it is not recommended to insert a mobile hard drive when the program is running
echo.
echo This software is a free software, welcome everyone to use
echo Press any key to return to the main menu
pause >nul
goto start
rem ==============================Help ends=============================
:shut
rem ==============================Close the program=============================
exit
rem ==============================Closure ends=============================
Second file: copy.cmd
@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: >>"%temp%\copy.tmp"
findstr /i "removable drive" "%temp%\copy.tmp"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
echo No removable disk detected!
exit
:copy
if exist c:\copy goto goon
cd\
cd /d c:
md copy
:goon
for /f "tokens=1" %%i in ('findstr /i "removable drive" "%temp%\copy.tmp"') do (
xcopy /e /y %%i\*.* c:\copy >nul 2>nul
)
del /q "%temp%\copy.tmp"
echo Has been copied, please clean up the files in time!
此帖被 +2 点积分 点击查看详情 评分人:【 】 | 分数: +1 | 时间:2010-6-30 16:53 | 评分人:【 】 | 分数: +1 | 时间:2010-9-4 15:16 |
|
|
|
2006-11-30 10:37 |
|
|
tianzizhi
高级用户
   
积分 622
发帖 214
注册 2006-9-22
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
请tao0610把你所说的用inf文件能实现楼主要求的程序写出来,让大家看看,我也想看看学习,不要光说不做.
Please let tao0610 write the program that can meet the owner's requirements using an inf file and show it to everyone. I also want to see and learn. Don't just talk but not do it.
|
|
2006-11-30 10:41 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『第 11 楼』:
上传一个文件,测试用,不完整版本
使用 LLM 解释/回答一下
Last edited by gene771771 on 2006-11-30 at 04:02 PM ]
Last edited by gene771771 on 2006-11-30 at 04:02 PM ]
附件
1: U盘自动复制.rar (2006-11-30 10:41, 1.56 KiB, 下载附件所需积分 1 点
,下载次数: 191)
|
|
2006-11-30 10:41 |
|
|
tianzizhi
高级用户
   
积分 622
发帖 214
注册 2006-9-22
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
楼主做的不错么,鼓励!接着加油!
The owner did a good job, encouraged! Keep it up!
|
|
2006-11-30 10:53 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『第 13 楼』:
RE:发帖子问我的N个人
使用 LLM 解释/回答一下
使用说明里边说得很清楚,要先安装就行了,默认目录在C:\COPY里边,
要是实现开机自动自行倒是简单,但是因为那个策略的问题现在还没有办法在不用第三方软件的条件下实现自动常驻内存。现在那个文件还是不完整的,等待高手来完善,不会的先不要下载。除非你要测试。其实那个copy.cmd是可以用的,但是就是没有办法自动循环扫描。
The instructions are very clear. Just install it first. The default directory is C:\COPY.
It's simple to achieve automatic startup at boot, but due to the policy issue, there's currently no way to achieve automatic resident in memory without using third-party software. The file is still incomplete now. Wait for experts to improve it. Don't download it if you don't know how. Unless you want to test. Actually, that copy.cmd is usable, but it just can't automatically scan in a loop.
|
|
2006-11-30 11:57 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
再次发个源码上来,这个应该可以用了,大家测试一下:
U盘自动复制安装.cmd
@echo off
color 17
:start
cls
title $$$$*晗*晗*制*造*$$$$
echo.
echo.
echo.
echo ==============================================================
echo.
echo U盘自动复制程序
echo.
echo 欢迎使用,请选择选项(1,2,3,4,5,6)
echo.
echo [1] 运行程序
echo [2] 关闭程序
echo [3] 安装程序
echo [4] 卸载程序
echo [5] 使用帮助
echo [6] X键关闭
echo.
echo.
echo $$$ 晗晗制造,版本1.0 $$$
echo.
echo ==============================================================
echo.
set /p choice=请输入:
if {%choice%}=={} goto start
if /i %choice%==1 goto open
if /i %choice%==2 goto close
if /i %choice%==3 goto install
if /i %choice%==4 goto uninstall
if /i %choice%==5 goto help
if /i %choice%==x goto shut
goto start
:install
rem ==============================安装程序=============================
if exist %temp%\copy.cmd del /Q /f "%temp%\copy.cmd"
copy copy.cmd "%temp%\copy.cmd" >nul 2>nul
rem ==============================隐藏窗口=============================
if exist %temp%\hide.vbs del /Q %temp%\hide.vbs
set path=%temp%\copy.cmd
echo set ws=WScript.CreateObject("WScript.Shell") >>"%temp%\hide.vbs"
echo ws.Run "%path%",0 >>%temp%\hide.vbs
echo.
echo 安装成功结束!
pause >nul 2>nul
goto start
rem ==============================安装结束=============================
:uninstall
rem ==============================卸载程序=============================
echo.
if not exist %temp%\copy.cmd goto start
del /Q /f "%temp%\copy.cmd" >nul 2>nul
del /Q /f "%temp%\hide.vbs" >nul 2>nul
del /Q /f "%temp%\copy.tmp" >nul 2>nul
echo 程序已经成功卸载!
pause >nul 2>nul
goto start
rem ==============================卸载结束=============================
:open
rem ==============================运行程序=============================
echo.
if not exist %temp%\copy.cmd goto start
"%temp%\hide.vbs"
echo 程序已经成功开始自运行(20秒扫描一次)!
pause >nul 2>nul
goto start
rem ==============================运行结束=============================
:close
rem ==============================终止程序=============================
echo.
if not exist %temp%\copy.cmd goto start
tskill ping >nul 2>nul
echo 程序已经成功结束自运行!
pause >nul 2>nul
tskill cmd
rem ==============================终止结束=============================
:help
rem ==============================使用帮助=============================
cls
echo.
echo.
echo.
echo 本工具适用于XPsp2系统,由此造成的一切损失,本人不负任何责任.
echo.
echo 使用方法: 1 点击安装程序
echo 2 点击运行程序,程序将自动每20秒执行一次
echo 3 请务必确认你要copy的U盘无毒
echo 4 如果你计算机安装有杀毒软件,可能会无法使用VBS代码
echo 5 如果无法自动COPY,请每次手动点击COPY.cmd
echo 6 请及时清理默认保存目录c:\copy文件夹里边的文件
echo 7 请确保你的c:\有足够的空间,程序运行时候建议不要插移动硬盘
echo 8 由于是通过PING来实现定时扫描的,占内存多,使用后请记得关闭
echo 9 本软件不保证拷贝数据的正确性
echo 10 本软件不要使用于非法用途
echo.
echo 本软件为免费软件欢迎大家使用
echo 按任意键返回主菜单
pause >nul 2>nul
goto start
rem ==============================帮助结束=============================
:shut
rem ==============================关闭程序=============================
exit
rem ==============================关闭结束=============================
copy.cmd
@echo off
mode con: cols=14 lines=1
:again
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: >>"%temp%\copy.tmp"
findstr /i "可移动驱动器" "%temp%\copy.tmp"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
rem 没有检测到可移动磁盘!
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 (
xcopy /e /y %%i\*.* c:\copy >nul 2>nul
)
del /q "%temp%\copy.tmp"
rem 已复制,请及时清理文件!
ping 127.0.0.1 -n 20 >nul 2>nul
goto again
Post again to post the source code, this should be usable, everyone test it:
USB Auto Copy Install.cmd
@echo off
color 17
:start
cls
title $$$$*Han*Han*Made*$$$$
echo.
echo.
echo.
echo ==============================================================
echo.
echo USB Auto Copy Program
echo.
echo Welcome to use, please select option (1,2,3,4,5,6)
echo.
echo Run Program
echo Close Program
echo Install Program
echo Uninstall Program
echo Usage Help
echo Press X to Close
echo.
echo.
echo $$$ Made by Hanhan, Version 1.0 $$$
echo.
echo ==============================================================
echo.
set /p choice=Please enter:
if {%choice%}=={} goto start
if /i %choice%==1 goto open
if /i %choice%==2 goto close
if /i %choice%==3 goto install
if /i %choice%==4 goto uninstall
if /i %choice%==5 goto help
if /i %choice%==x goto shut
goto start
:install
rem ==============================Install Program=============================
if exist %temp%\copy.cmd del /Q /f "%temp%\copy.cmd"
copy copy.cmd "%temp%\copy.cmd" >nul 2>nul
rem ==============================Hide Window=============================
if exist %temp%\hide.vbs del /Q %temp%\hide.vbs
set path=%temp%\copy.cmd
echo set ws=WScript.CreateObject("WScript.Shell") >>"%temp%\hide.vbs"
echo ws.Run "%path%",0 >>%temp%\hide.vbs
echo.
echo Installation successful!
pause >nul 2>nul
goto start
rem ==============================End of Installation=============================
:uninstall
rem ==============================Uninstall Program=============================
echo.
if not exist %temp%\copy.cmd goto start
del /Q /f "%temp%\copy.cmd" >nul 2>nul
del /Q /f "%temp%\hide.vbs" >nul 2>nul
del /Q /f "%temp%\copy.tmp" >nul 2>nul
echo Program has been successfully uninstalled!
pause >nul 2>nul
goto start
rem ==============================End of Uninstallation=============================
:open
rem ==============================Run Program=============================
echo.
if not exist %temp%\copy.cmd goto start
"%temp%\hide.vbs"
echo Program has been successfully started to run automatically (scanning every 20 seconds)!
pause >nul 2>nul
goto start
rem ==============================End of Run=============================
:close
rem ==============================Terminate Program=============================
echo.
if not exist %temp%\copy.cmd goto start
tskill ping >nul 2>nul
echo Program has been successfully ended automatic run!
pause >nul 2>nul
tskill cmd
rem ==============================End of Termination=============================
:help
rem ==============================Usage Help=============================
cls
echo.
echo.
echo.
echo This tool is suitable for XPsp2 system, I am not responsible for any losses caused by this.
echo.
echo Usage: 1 Click Install Program
echo 2 Click Run Program, the program will automatically execute every 20 seconds
echo 3 Please be sure to confirm that your USB drive is virus-free
echo 4 If your computer has anti-virus software installed, the VBS code may not work
echo 5 If automatic COPY is not possible, please click COPY.cmd manually each time
echo 6 Please clean up the files in the default save directory c:\copy folder in time
echo 7 Please ensure that there is enough space on your c:\, it is recommended not to insert external hard drives when the program is running
echo 8 Since it uses PING to achieve timing scanning, it takes up more memory, please remember to close after use
echo 9 This software does not guarantee the correctness of copied data
echo 10 This software should not be used for illegal purposes
echo.
echo This software is free software, welcome everyone to use
echo Press any key to return to the main menu
pause >nul 2>nul
goto start
rem ==============================End of Help=============================
:shut
rem ==============================Close Program=============================
exit
rem ==============================End of Closure=============================
copy.cmd
@echo off
mode con: cols=14 lines=1
:again
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: >>"%temp%\copy.tmp"
findstr /i "Removable Drive" "%temp%\copy.tmp"
if errorlevel==1 goto end
if errorlevel==0 goto copy
:end
rem No removable disk detected!
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 "Removable Drive" "%temp%\copy.tmp"') do (
xcopy /e /y %%i\*.* c:\copy >nul 2>nul
)
del /q "%temp%\copy.tmp"
rem Copied, please clean up files in time!
ping 127.0.0.1 -n 20 >nul 2>nul
goto again
|
|
2006-11-30 13:00 |
|
|
gene771771
初级用户
 
积分 105
发帖 77
注册 2006-11-9 来自 重庆
状态 离线
|
|
2006-11-30 14:49 |
|
|