掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
FileSystemObjectでファイルのリネームと移動をするには? (ID:79698)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
Dim colFilesystem As Object Dim strOldPath As String Dim strNewPath As String Dim strOldFileName As String Dim strNewFileName As String Set colFilesystem = CreateObject("Scripting.FileSystemObject") strOldPath = "D:\NKSYS\DAT\" strNewPath = "D:\NKSYS\BKUP\" strOldFileName = "Nkdata.cvs" strNewFileName = "20031006Nkdata.cvs" ' ファイルの移動 colFilesystem.MoveFile strOldPath & strOldFileName, strNewPath Set objFile = colFilesystem.GetFile(strNewPath & strOldFileName) ' ファイルのリネーム objFile.Name = strNewFileName ' オブジェクトを解放 Set colFilesystem = Nothing こんな感じでどうでしょう?
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.