掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
フォルダの削除するには? (ID:140786)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
フォルダとそのフォルダの中に入っているデータを消したいのですが、 最後のフォルダを削除するところで、エラーがでてしまいます。 どなたかご教授いただけると幸いです。 よろしくお願いします。 Const BAK = "BAK" Const TMP = "TMP" Sub aaa() Dim sDestination As String sDestination = "D\catdb\usr\temp01" Dim sBAKPath As String Dim sTMPPath As String sBAKPath = sDestination & "\" & BAK sTMPPath = sDestination & "\" & TMP Dim BAKFolder As String Dim TMPFolder As String BAKFolder = Dir(sBAKPath, vbDirectory) TMPFolder = Dir(sTMPPath, vbDirectory) Dim iFile1 As String Dim iFile2 As String iFile1 = Dir(sBAKPath & "\" & "*.*") iFile2 = Dir(sTMPPath & "\" & "*.*") If BAKFolder <> "" Then If iFile1 <> "" Then Kill sBAKPath & "\" & "*.*" End If End If RmDir (sBAKPath) If TMPFolder <> "" Then iFile2 = Dir(sTMPPath & "\" & "*.*") If iFile2 <> "" Then Kill sTMPPath & "\" & "*.*" End If End If RmDir (sTMPPath) ←ここでエラー"Path/File access error" End Sub
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.