Classic ASP
폴더 생성 및 이름 변경
NJHouse
2014. 8. 6. 08:00
1. 폴더 생성
Dim spath : spath = Server.mapPath("경로") ' 우선 경로를 지정해 준다. Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") Dim folder : folder = "경로" ' 폴더 생성 fso.CreateFolder(folder) ' 폴더에 파일이 존재하는지의 여부 판단 if (fso.FileExists(spath & folder)) then -- 내용 -- end if Set fso = Nothing
2. 폴더 이름 변경
Dim strDirold : strDirold = 기존폴더명 Dim strFname : strFname = 변겅폴더명 If objFs.FolderExists(strDirold) Then set objFolder = objFs.GetFolder(strDirold) if isobject(objFolder) then objFolder.name = strFname end if set objFolder = Nothing End if
반응형