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

[µo°Ý] Dir ¶×¥X«ü¥O¥i§_±Æ°£ ¥Ø¿ý©O?

[µo°Ý] Dir ¶×¥X«ü¥O¥i§_±Æ°£ ¥Ø¿ý©O?

Dear ¦U¦ì¤j¤j~

¦pªG¦³¸Ó©«µo°Ý¦b³oª©¤£¦nªº¸Ü¡A½Ð§R°£©Î²¾°Ê¤§~~ ÁÂÁ¡C

½Ð°Ý Dir {path} >{path}.txt
¶×¥Xdirectories list µ²ºcªº²M³æªº«ü¥O¡A¯à§_±Æ°£¥Ø¿ý©O?

export directories list , but exclude xxx,xxx

§Ú¤wª¾¬Y¨Ç³nÅé¡Ahttp://www.infonautics.ch/directorylistprint/  
¦³³oºØ¥\¯à¡A¦ý¬O»Ý­nlicence¡C
·Qª¾¹D¦³¨S¦³¥Î«ü¥O´N¯à°µ¨ìªº¤è¦¡?

ÁÂÁ¤j®a~

¥ý¥Î dir /?
¬ddir³o­Ó«ü¥O¦U°Ñ¼Æªº·N¸q

¦pªG§A­n±Æ°£ªº¬O¥þ³¡ªº¤l¥Ø¿ý
dir {path} /A-D >{path}.txt  
¤£¥]§tÁôÂÃÀÉ
dir {path} /A-D-H >{path}.txt
¥u­nÀɦW
dir {path} /A-D-H /B >{path}.txt

¦pªG¥u¬O­n±Æ°£¯S©w¥Ø¿ý§Ú´N¤£²M·¡¤F

TOP

dir/?´N¥i¬d¸ß¥þ³¡ªº°Ñ¼Æ

TOP

¦^´_ 3# prin.huang


Sub P_Sample004()
    Dim myFileName As String
    myFileName = Application.InputBox(Prompt:= _
        "½Ð¿é¤JÀɮצWºÙ¡B¸ê®Æ§¨¦WºÙªº§¹¾ã¸ô®|", Title:="½T»{¦s¦b")
    If Len(Dir(myFileName, vbDirectory)) > 0 Then
        If (GetAttr(myFileName) And vbDirectory) = vbDirectory Then
            MsgBox "©Ò«ü©w¤§¸ê®Æ§¨¦s¦b¡C"
       Else
            MsgBox "©Ò«ü©w¤§Àɮצs¦b¡C"
       End If
    Else
        MsgBox "©Ò«ü©w¤§ÀɮשάO¥Ø¿ý¤£¦s¦b¡C"
    End If
End Sub

Sub P_Sample003()
    Dim myPath     As String
    Dim myFileName As String
    Dim i          As Long
    myPath = ThisWorkbook.Path & "\"        '¥ô·Nªº¸ê®Æ§¨
    myFileName = Dir(myPath, 0)
    Do While Len(myFileName) > 0
        Debug.Print myPath & myFileName
        myFileName = Dir()
    Loop
End Sub

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD