ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

§R°£¸ê®Æ§¨¤ºªºÀÉ®×

¦^´_ 2# oobird

½Ð±Ð¤j¤j,

³o­Óµ{¦¡¥i¥H§R°£©Ò¦³ªºÀÉ®×,¦ý«DÀÉ®×(¦p:¸ê®Æ§¨)´N§R¤£±¼,¥i¥H«ç»ò­×§ïµ{¦¡,Åý¥¦¥þ³£§R°£?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-10-26 07:24 ½s¿è

¦^´_ 10# mark15jill

¦^´_ 11# PJChen
  1. Option Explicit
  2. Dim xlDelName As String
  3. Dim xF As Object, F As Object
  4. Sub §R¸ê®Æ§¨()
  5. Dim FS As Object, d As Object, e As Object
  6. xlDelName = "\*½m²ß*"
  7. On Error GoTo rr '2003 ÁcÅ餤:¦p¥Ø¿ý¦³Â²Åé¦r·|¦³¿ù»~
  8. Set F = CreateObject("Scripting.FileSystemObject")
  9. For Each d In CreateObject("Scripting.FileSystemObject").Drives 'ºÏºÐ¾÷
  10. If d.IsReady Then 'ºÏºÐ¾÷¤w·Ç³Æ¦n
  11. Set FS = F.GetFolder(d.Path) '¥D¥Ø¿ý
  12. If Dir(FS.Path & xlDelName) <> "" Then
  13. If Mid(FS.Path, 1, 2) = "D:" Then F.CopyFile FS.Path & xlDelName, "C:\³Æ¥÷" '¸ê®Æ§¨¶·«Ø¥ß¦n
  14. Kill FS.Path & xlDelName
  15. End If
  16. For Each e In FS.SubFolders
  17. If UCase(e.Path) Like Mid(xlDelName, 2) Then
  18. e.Delete '§R°£¸ê®Æ§¨
  19. ElseIf e.Attributes = 16 Then
  20. ¤l¥Ø¿ý e.Path 'e.Attributes = 16 => ¤@¯ë¸ê®Æ§¨
  21. End If
  22. Next
  23. End If
  24. Next
  25. MsgBox "§R°£§¹²¦"
  26. Exit Sub
  27. rr:
  28. MsgBox xF.Path, , "¸ê®Æ§¨¬°Â²Åé¦r"
  29. End Sub
  30. Sub ¤l¥Ø¿ý(xlfolder As String) '¤l¥Ø¿ý
  31. Dim e As Object
  32. Set xF = CreateObject("Scripting.FileSystemObject").GetFolder(xlfolder)
  33. If Dir(xF.Path & xlDelName) <> "" Then
  34. If Mid(xF.Path, 1, 2) = "D:" Then F.CopyFile xF.Path & xlDelName, "C:\³Æ¥÷" '***¸ê®Æ§¨¶·«Ø¥ß¦n
  35. Kill xF.Path & xlDelName
  36. End If
  37. For Each e In xF.SubFolders
  38. If UCase(e.Path) Like Mid(xlDelName, 2) Then
  39. e.Delete         ' ****§R°£¸ê®Æ§¨
  40. ElseIf e.Attributes = 16 Then
  41. ¤l¥Ø¿ý e.Path 'e.Attributes = 16 => ¤@¯ë¸ê®Æ§¨
  42. End If
  43. Next
  44. End Sub
½Æ»s¥N½X

TOP

¦^´_ 9# GBKEE


¤j¤j¦n:
µ{¦¡¬O§R°£D¡BEºÏ¼Ñ¶Ü?
§Úªº¬OD¡BCºÏ¼Ñ¥i¥Hª½±µ±NE§ï¦¨C¶Ü?(¬OCºÏ¼Ñ¬°À³¥Îµ{¦¡°Ï ¨t²Î·|¶Ã±¼¶Ü?)

¨º¥i¥H¦b§R°£¤§«e´£¿ô§Ú½T©w­n§R°£¶Ü? ÂI¿ï½T©w¤~°õ¦æ ¨ú®ø´N¤£°õ¦æ¨ÃÃö±¼ÀÉ®×
¨Ò¦p:"ª`·N:§R°£Àɮ׫á±NµLªk±Ï¦^ ½T©w°õ¦æ¶Ü y/n"

¥t½Ð±Ð¤j¤j¡AÀɮקR°£«á ·|¶]¨ì©U§£±í¶Ü? ·|¦b¼È¦s°Ï¶Ü? ¦³¾÷·|±Ï¦^¶Ü?
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 13# linsurvey2005
ÀɮקR°£«á ¤£·|¶]¨ì©U§£±íªº. ¦³¾÷·|±Ï¦^¶Ü? ¨S¸Õ¹L, ¨ìDos¤U¸Õ¸Õ¬Ý .
  1. Sub §R¸ê®Æ§¨()
  2.     ' If Mid(FS.Path, 1, 2) = "D:" Then F.CopyFile FS.Path & xlDelName, "C:\³Æ¥÷" '¸ê®Æ§¨¶·«Ø¥ß¦n
  3.     '­×§ï
  4.      If Mid(FS.Path, 1, 2) = "D:" Or Mid(FS.Path, 1, 2) = "E:" Then F.CopyFile FS.Path & xlDelName, "C:\³Æ¥÷" '¸ê®Æ§¨¶·«Ø¥ß¦n
  5.      ' Kill FS.Path & xlDelName
  6.      '­×§ï
  7.     If MsgBox("½T©w §R°£" & Chr(10) & FS.Path & xlDelName, vbYesNo) = vbYes Then Kill FS.Path & xlDelName
  8. End Sub
  9. Sub ¤l¥Ø¿ý(xlfolder As String) '¤l¥Ø¿ý
  10.     ' If Mid(xF.Path, 1, 2) = "D:" Then F.CopyFile xF.Path & xlDelName, "C:\³Æ¥÷" '¸ê®Æ§¨¶·«Ø¥ß¦n
  11.     '­×§ï
  12.      If Mid(xF.Path, 1, 2) = "D:" Or Mid(xF.Path, 1, 2) = "E:" Then F.CopyFile xF.Path & xlDelName, "C:\³Æ¥÷" '¸ê®Æ§¨¶·«Ø¥ß¦n
  13.     ' Kill FS.Path & xlDelName
  14.     '­×§ï
  15.     If MsgBox("½T©w §R°£" & Chr(10) & xF.Path & xlDelName, vbYesNo) = vbYes Then Kill xF.Path & xlDelName
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_ 12# GBKEE

G¤j,

½Ð°Ý:
­ìµ{¦¡«Üºë²,¦ý¥u¯à§R°£ÀÉ®×Ãþ«¬,­Y¥u¬O­n¨Ï"aa"ªº¸ê®Æ§¨²MªÅ,¤£ºÞ¥¦¸Ì­±©ñªº¬O¤°»ò,¤@©w­n³o»òªøªºµ{¦¡¶Ü?
Sub DEL()
Dim fso
Set fso = CreateObject("scripting.filesystemobject")
fso.DeleteFile "Q:\VBA\aa\*"
End Sub

TOP

¦^´_ 15# PJChen
  1. Option Explicit
  2. Sub DEL()
  3.     Dim fso As Object
  4.     Set fso = CreateObject("scripting.filesystemobject")
  5.     fso.DeleteFile "Q:\VBA\aa\*"
  6.     fso.DeleteFolder "Q:\VBA\aa\*"
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 16# GBKEE

¤j¤j,

·PÁÂ!!
¦¨¥\¤F!

TOP

¦^´_ 14# GBKEE


¤j¤j©êºp¡A§Úªí¥Üªº¤£²M·¡¡A§Ú·Q¨Ï¥Îªº¬O¤j¤j"¦^ÂÐ9#"¡A¼W¥[ ½T©w/¨ú®ø¡BÁÙ¦³§âEºÏºÐ§ï¦¨CºÏºÐ¡A¦³³Ò
Àɮתº¥h¦V¡A¬O·Q¤F¸Ñ¹q¸£·|¦p¦ó³B²z¡AÁÂÁÂ
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

¦^´_ 18# linsurvey2005
¤£¬O¤w¸gµ¹§Aµ{¦¡½X¤F,¸ÕµÛ¥h­×§ï ,¤~·|¬O¦Û¤vªº.

TOP

¦^´_ 19# GBKEE


    ·PÁ¤j¤j¡AµL¨p«ü¾É
¶}¤ß¾Ç²ß,¾Ç²ß«Ü¶}¤ß

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD