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

[µo°Ý] »yªk°ÝÃD

[µo°Ý] »yªk°ÝÃD

¥»©«³Ì«á¥Ñ pitera88 ©ó 2012-1-4 20:03 ½s¿è

object.Delete force

½Ð°Ý«e­±ªºobject­n«ç»ò¿é¤Jªü??§Ú¬O·Q«ü©w¬Y­Ó¸ê®Æ§¨¡A¨Ò¦p¡G"c:\456\" §Ú¥ÎÅܼƤ]¤£¯à¥Î­C

¦Ñ®vÁÙ¨S±Ð¨ì³o¡A¥ý¨Ó°Ý°Ý

§Ú¬O·Q§R¬Y­Ó¸ê®Æ§¨ùتºÀɮסA¤£¬O¬¡­¶Ã¯ùتº¤º®e®@
¤¯¥S

¦^´_ 1# pitera88


    ¦³¤j¤jÀ°¤@¤U¶Ü
¤@ª½§ä¤£¨ìµª®×¡AÁÂÁ®@
¤¯¥S

TOP

¦^´_ 1# pitera88

«Üª½Ä±ªº»yªk

'§R°£ÀÉ®×
Sub DeltxtFile()
Kill "D:\test.txt"
End Sub

'§R°£¸ê®Æ§¨
Sub DelDir()
RmDir "D:\test"
End Sub

TOP

¦^´_ 3# lcc_seven


¯»¤£¦n·N«ä¡A¦]¬°²{¦b¦A¾Çªº¬O¡õ
    object.Delete force

³o­Ó¤£¬O¤]¥i¥H¥Î¨Ó§RÀɤθê®Æ§¨¶Ü  
ÁÙ¬O¥u¯à§R¬¡­¶Ã¯ªº¤u§@ªí?

ÁÂÁ®@
¤¯¥S

TOP

¥»©«³Ì«á¥Ñ kimbal ©ó 2012-1-5 00:21 ½s¿è

...§A»¡ªºÀ³¸Ó¬OFILESYSTEMOBJECT

¥H¤U¬O§RÀɪº:
object.DeleteFile "filename", force
force¬Otrueªº¸Ü, ÀÉ®×°ßŪ®É¤]¥idelete

dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\somefile.txt") Then
   filesys.DeleteFile "c:\somefile.txt",TRUE
End If

½s¿è: ¬Ýº|¤FÃD¥Ø,¬O®É­ÔºÎ¤F
¥H¤U¬O§R¤å¥ó§¨ªº:
FORCE¬OTRUEªº¸Ü,¤å¥ó§¨¦³ªF¦è³£·|DELETE

Dim filesys
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FolderExists("c:\FOLDER\") Then
       filesys.DeleteFolder "c:\FOLDER", True
    End If
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

¦^´_ 5# kimbal

kimbal¤j¤j ÁÂÁ®@!!  ±ß¦w

    ...§A»¡ªºÀ³¸Ó¬OFILESYSTEMOBJECT

¥H¤U¬O§RÀɪº:
object.DeleteFile "filename", force
force¬Otrueªº¸Ü, ÀÉ®×°ßŪ®É¤]¥idelete

dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject") ->³o¦æ
If filesys.FileExists("c:\somefile.txt") Then
   filesys.DeleteFile "c:\somefile.txt",TRUE  ->³o¦æ
End If


½s¿è: ¬Ýº|¤FÃD¥Ø,¬O®É­ÔºÎ¤F
¥H¤U¬O§R¤å¥ó§¨ªº:
FORCE¬OTRUEªº¸Ü,¤å¥ó§¨¦³ªF¦è³£·|DELETE

Dim filesys
    Set filesys = CreateObject("Scripting.FileSystemObject") ->³o¦æ
    If filesys.FolderExists("c:\FOLDER\") Then
       filesys.DeleteFolder "c:\FOLDER", True -> ³o¦æ
    End If


¨º2¦æ¬O¥²»Ý¤@°_ªº´N¬O¤F

¦A½Ð±Ð CreateObject("Scripting.FileSystemObject") ³o¬O¤°»ò²[¼Æ?? ¬O¤°»ò·N«ä? ¦b»¡©úùا䪺¨ì¶Ü?
¤¯¥S

TOP

³æ¯Â¨Ï¥ÎDelete»yªk¤è¦¡¦p¤U¡G(¨S¦³¥[if§P§O¡A½Ð¦Û¦æ¥ý«Ø¥ßD:\test.txt)
¦Ü©óforceªº¥Îªk¡G¿ï¾Ü¶µ¡C¨M©w°ßŪÀɮשθê®Æ§¨¬O§_¥i¥H§R°£ªº¥¬ªL­È¡A­Y¬O True «h§R°£¡AFalse ¤£§R°£(¹w³]­È)¡C

Sub DeleteFile()
Dim FSO As Object
Dim DelFile As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set DelFile = FSO.GetFile("D:\test.txt")
DelFile.Delete
End Sub

TOP

¦^´_ 6# pitera88

¦pªG­n§R°£¸ê®Æ§¨

Sub DeleteFolder()
Dim FSO As Object
Dim DelFolder As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set DelFolder = FSO.GetFolder("D:\·s¸ê®Æ§¨")
DelFolder.Delete
End Sub

PS¡Gª½±µ§R°£¡A¤£·|´£¥Ü¸ê®Æ§¨¸Ì­±¬O§_¦³ÀɮסC

TOP

¦^´_ 6# pitera88


   

TOP

¦^´_ 9# GBKEE


    ÁÂÁÂgbkee¤j¤j¡A¨ü±Ð¤F

·P®¦¡A§V¤Ok¤å
¤¯¥S

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD