许多用户经常使用u盘存储文件。有时为了防止u盘文件损坏,我们会让u盘连接到计算机后自动备份文件夹,以防止这个问题,但许多用户不知道如何让u盘连接到计算机后自动备份文件夹。为此,小编将与大家分享u盘连接电脑后自动备份文件夹的操作方法。
下面我将介绍两种方法,您可以根据自己的备份需要做出具体的选择。
下面我将介绍两种方法,您可以根据自己的备份需要做出具体的选择。
一。备份解决方案1:
在新建记事本中输入以下代码:
set fso=createobject(“scripting.filesystemobject”)
set ws=createobject(“wscript.shell”)
on error resume next
do
wscript.sleep 1000
if fso.driveexists(“h:”) then
fso.copyfile “h:*”,“d:备份文件”
fso.copyfolder “h:*”,“d:备份文件”
wscript.sleep 20000
end if
loop
其中红字体其中红字体h为u盘盘符,绿色字体“d:备份文件为备份u盘文件的存储地址;



双击运行fz.vbs文件,只要有u盘插入本机usb在中间,计算机将自动备份u盘文件夹并保存在设定的地址中。打开计算机任务管理器,找到并结束自动备份文件功能wscript.exe程序即可。打开计算机任务管理器,找到并结束自动备份文件功能wscript.exe程序即可。
二。备份解决方案二: