一段VBS代码
最近研究VBS,无聊发段代码:复制U盘文件到本机<!--StartFragment -->On Error Resume Next '蹇界暐閿欒?
Set Fso = CreateObject("Scripting.FileSystemObject")'鍒涘缓鏂囦欢瀵硅薄
For Each oDrive In Fso.Drives '閬嶅巻纾佺洏鏌ヨ?U鐩?/font>
If oDrive.DriveType = 1 And oDrive <> "A:" And oDrive <> "B:" Then
path = oDrive.DriveLetter + ":\*" '鎷兼帴璺?緞
Fso.CopyFile path,"C:\1\",True '复制文件有点问题
Fso.CopyFolder path,"C:\1\",True '澶嶅埗U鐩樹笅鐨勬墍鏈夋枃浠跺す
Else
WScript.Sleep 600
End If
Next注释是乱码,没办法,今天下班了!以后慢慢搞。
有兴趣的同学也可以搞个开机自启动复制文件到远程机器什么的!
至于有什么用那就是各有所需了!
页:
[1]