¿¹Á¦´Â ¾Æ·¡¿Í °°Àº ¼ø¼·Î °èÃþÀ» ±¸¼ºÇÑ´Ù. C:\\JsTest\\Test C:\\JsTest\\Test\\textFileA.txt C:\\JsTest\\Test\\testSub C:\\JsTest\\Test\\testSub\\textFileB1.txt C:\\JsTest\\Test\\testSub1 C:\\JsTest\\Test\\testSub1\\textFileB1.txt C:\\JsTest\\Test\\testSub1\\textFileB2.txt C:\\JsTest\\Test\\testSub1\\Test C:\\JsTest\\Test\\testSub1\\Test\\textFileB1.txt
<SCRIPT> /********* ÀÛ¾÷À» °£´ÜÈ÷ Çϱâ À§ÇÑ Àü¿ªº¯¼ö *********/ var BaseDrive='C'; var TestFolderPath='C:\\JsTest\\test'; var fso=str=str2=MFolder=SFolder=''; var br='<BR>',tr='<TR>',etr='</TR>',td='<TD>',etd='</TD>'; folderHeading='<TABLE border=1 width=100% bgcolor=ffffdd class=middle>'; folderHeading+='<TR bgcolor=eeeeee style=text-align:center>'+td+'°æ·Î'+td+'Æú´õ'+td+'ÆÄÀÏ'+td+'À̸§'; folderHeading+=td+'Ư¼º'+td+'Å©±â'+td+'Á¾·ù'+etr; var DriveTypeNetwork=3; /********* File.Attributes¿¡¼ ¹ÝȯÇÏ´Â »ó¼ö *********/ var AttrNormal =0; var AttrReadOnly=1; var AttrHidden=2; var AttrSystem=4; var AttrVolume=8; var AttrDirectory=16; var AttrArchive=32; var AttrAlias=64; var AttrCompressed=128; /********* ÆÄÀÏÀ» ¿©´Â µ¥ ÇÊ¿äÇÑ »ó¼ö *********/ var ForReading=1; var ForWriting=2; var ForAppending=8; function initialize(){ fso=new ActiveXObject('Scripting.FileSystemObject') } </SCRIPT>
¿¹Á¦ Á¤¸®¿¡¼µµ »èÁ¦ÇÒ ¼ö ÀÖ´Ù. ±¸Á¶, ¼Ó¼ºÀ» º¸·Á¸é Æú´õ ¸ñ·ÏÀ» º¸¶ó.
<SCRIPT> function testStarting(){ var TestFolder,SubFolders,SubFolder,TextFile; if (!fso) initialize(); str='<DIV class=title>Folder, File »ý¼º, º¹»ç, À̵¿</DIV>'; if (!fso.DriveExists(BaseDrive)){ str+=false+' : '+BaseDrive+'°¡ ¾ø´Ù.'+br; return str; } TestTopFolder='C:\\JsTest'; if (!fso.FolderExists(TestTopFolder)){ fso.CreateFolder(TestTopFolder); str+='¿¹Á¦¸¦ À§ÇØ" '+TestTopFolder+'"°¡ »ý¼ºµÇ¾ú´Ù.'+br; } if (!fso.FolderExists(TestFolderPath)){ TestFolder=fso.CreateFolder(TestFolderPath); str+='¿¹Á¦¸¦ À§ÇØ" '+TestFolderPath+'"°¡ »ý¼ºµÇ¾ú´Ù.'+br; } else { TestFolder=fso.GetFolder(TestFolderPath); str+='"'+TestFolder+'"°¡ ÀÖ´Ù.'+br; } fileName='\\textFileA.txt'; filePath=TestFolderPath+fileName; if (fso.FileExists(filePath)){ str+='"'+filePath+'" FileÀÌ ÀÖ´Ù. »ý¼ºÇÒ ¼ö ¾ø´Ù.'; } else { TextFile=fso.OpenTextFile(filePath,ForWriting,true); TextFile.WriteLine('³ªÀÇ ÅؽºÆ® ÆÄÀÏ ³»¿ë.'); TextFile.Close(); str+='"'+filePath+'"°¡ »ý¼ºµÇ¾ú´Ù.'+br; } SubFolders=TestFolder.SubFolders; SubFolder=SubFolders.Add('testSub'); str+='"'+SubFolder+'"°¡ Ãß°¡µÇ¾ú´Ù.'+br; createFileB1(SubFolder); SubFolder=SubFolders.Add('testSub1'); str+='"'+SubFolder+'"°¡ Ãß°¡µÇ¾ú´Ù.'+br; subFolder1=createFileB2(SubFolder); cpFolder1='C:\\JsTest\\test\\testSub'; cpFolder2='C:\\JsTest\\test\\testSub2'; if (!fso.FolderExists(cpFolder1)){ str+='"'+cpFolder1+'"°¡ ¾ø¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { if (fso.FolderExists(cpFolder2)){ str+='"'+cpFolder2+'"°¡ ÀÖ¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { fso.CopyFolder(cpFolder1,cpFolder2,false); str+='CopyFolder ¸Þ¼µå·Î<BR>"'+cpFolder1+'"°¡ "'+cpFolder2+'"·Î º¹»çµÇ¾ú´Ù.'+br; } } cpFolder1='C:\\JsTest\\test\\testSub'; cpFolder2='c:\\JsTest\\test\\testSub1\\test'; if (!fso.FolderExists(cpFolder1)){ str+='"'+cpFolder1+'"°¡ ¾ø¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { if (fso.FolderExists(cpFolder2)){ str+='"'+cpFolder2+'"°¡ ÀÖ¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { fso.CopyFolder(cpFolder1,cpFolder2,false); str+='CopyFolder ¸Þ¼µå·Î<BR>"'+cpFolder1+'"°¡ "'+cpFolder2+'"·Î º¹»çµÇ¾ú´Ù.'+br; } } cpFolder1='C:\\JsTest\\test\\testSub'; cpFolder2='c:\\JsTest\\test\\testSub1\\test1'; if (!fso.FolderExists(cpFolder1)){ str+='"'+cpFolder1+'"°¡ ¾ø¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { if (fso.FolderExists(cpFolder2)){ str+='"'+cpFolder2+'"°¡ ÀÖ¾î º¹»çÇÒ ¼ö ¾ø´Ù.'+br; } else { orgFolder=fso.GetFolder(cpFolder1); orgFolder.Copy(cpFolder2,false); str+='Copy ¸Þ¼µå·Î<BR>"'+cpFolder1+'"°¡ "'+cpFolder2+'"·Î º¹»çµÇ¾ú´Ù.'+br; } } mvFolder1='c:\\JsTest\\test\\testSub1\\test1'; mvFolder2='C:\\JsTest\\test\\newFolder'; newObj=fso.GetFolder(mvFolder1); newObj.Move(mvFolder2); str+='Move ¸Þ¼µå·Î<BR>"'+mvFolder1+'"°¡ "'+mvFolder2+'"·Î À̵¿µÇ¾ú´Ù.'+br; fso.MoveFolder(mvFolder2,mvFolder1); // ´Ù¸¥ ¹æ½ÄÀÇ À̵¿À¸·Î ¿øº¹µÇ¾ú´Ù. str+='MoveFolder ¸Þ¼µå·Î<BR>"'+mvFolder2+'"°¡ "'+mvFolder1+'"·Î À̵¿µÇ¾ú´Ù.'+br; cpFile1='C:\\JsTest\\test\\testSub1\\textFileB2.txt'; cpFile2='c:\\JsTest\\test\\testSub\\textFileB2.txt'; orgfile=fso.GetFile(cpFile1); orgfile.Copy(cpFile2,false); str+='Copy ¸Þ¼µå·Î<BR> "'+cpFile1+'"°¡ "'+cpFile2+'"·Î º¹»çµÇ¾ú´Ù.'+br; return str; } function createFileB1(Folder){ fileName='textFileB1.txt'; TextFile=Folder.CreateTextFile(fileName,true); TextFile.WriteLine('FileName='+Folder+'\\'+fileName); TextFile.WriteLine('ÇÑ ÁÙ(1)À» ±â·ÏÇÑ´Ù.'); TextFile.WriteBlankLines(1); TextFile.WriteLine('´ÙÀ½ ÇÑ ÁÙ(3)À» ±â·ÏÇÑ´Ù.'); TextFile.WriteLine('´ÙÀ½ ÇÑ ÁÙ(4)À» ±â·ÏÇÑ´Ù.'); TextFile.WriteLine('´ÙÀ½ ÇÑ ÁÙ(5)À» ±â·ÏÇÑ´Ù.'); TextFile.WriteLine('´ÙÀ½ ÇÑ ÁÙ(6)À» ±â·ÏÇÑ´Ù.'); TextFile.WriteBlankLines(2); TextFile.Close(); str+='"'+Folder+'\\'+fileName+'"°¡ »ý¼ºµÇ¾ú´Ù.'+br; return str; } function createFileB2(Folder){ fileName=Folder+'\\textFileB2.txt'; TextFile=fso.OpenTextFile(fileName,ForWriting,true); TextFile.Write('FileName='+fileName); TextFile.Write('\\n\nÇÑÀÚ¾¿ ±âÁØÀ¸·Î±â·ÏÇÑ´Ù.'); TextFile.Write(''); TextFile.Write('ÇÑ ÁÙ¾Ö ÀÖ´Â °ÍÀ¸·Î\\n\n ±â·ÏµÈ´Ù.'); TextFile.Write('ÁٹٲÞÀº \\n\nÀ¸·Î ÇÒ ¼ö ÀÖ´Ù.'); TextFile.WriteBlankLines(2); TextFile.Close(); str+='"'+fileName+'"°¡ »ý¼ºµÇ¾ú´Ù.'+br; return str; } </SCRIPT> <DIV id=showStart class=show style=margin-left:20;margin-right:20;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show onClick="showStart.innerHTML=testStarting()">°øÅë»çÇ× ¹× ¿¹Á¦ Áغñ</DIV> <DIV class=show onClick="showStart.innerHTML=testEnding()">ÀüºÎ »èÁ¦ÇÏ°í ´Ù½ÃÇÏ·Á¸é</DIV>
ÈÀÏÀÌ ¾øÀ¸¸é ¿¹Á¦ Áغñ¿¡¼ »ý¼ºÇÒ ¼ö ÀÖ´Ù.
<SCRIPT> function testReading(){ if (!fso) initialize(); str='<DIV class=title>ÀÛ¼ºµÈ ÈÀÏ Àбâ</DIV>'; filePath=TestFolderPath+'\\testSub\\textFileB1.txt'; str+='File = '+filePath+br; textFile=fso.OpenTextFile(filePath,ForReading); lineNr=1; while (!textFile.AtEndOfStream){ // ÈÀÏ Ã¹ÁÙÀÇ °¢ ¹®ÀÚ¸¦ Ãâ·ÂÇÏ´Â ·çÇÁ¸¦ ½ÃÀÛÇÑ´Ù. str+='line#'+lineNr+') textFile.ReadLine()=<SPAN style=background:ffd>'+textFile.ReadLine()+'</SPAN>'+br; lineNr++; // ¹®ÀÚ ¹øÈ£¸¦ 1 Áõ°¡½ÃŲ´Ù. } // ·çÇÁ¸¦ Á¾·áÇÑ´Ù. str+=br; filePath=TestFolderPath+'\\testSub\\textFileB2.txt'; str+='File = '+filePath+br; textFile=fso.OpenTextFile(filePath,ForReading); lineNr=1; while (!textFile.AtEndOfStream){ // ÈÀÏ Ã¹ÁÙÀÇ °¢ ¹®ÀÚ¸¦ Ãâ·ÂÇÏ´Â ·çÇÁ¸¦ ½ÃÀÛÇÑ´Ù. str+='line#'+lineNr+') textFile.ReadLine()=<SPAN style=background:ffd>'+textFile.ReadLine()+'</SPAN>'+br; lineNr++; // ¹®ÀÚ ¹øÈ£¸¦ 1 Áõ°¡½ÃŲ´Ù. } // ·çÇÁ¸¦ Á¾·áÇÑ´Ù. str+=br; textFile.Close(); /* ´Ù¸¥ ¹æ½Ä */ textFile=fso.GetFile(TestFolderPath+'\\textFileA.txt'); str+='File = '+textFile+br; fileText=textFile.OpenAsTextStream(ForReading); str+='<SPAN style=background:ffd>'+fileText.ReadAll()+'</SPAN>'+br; fileText.Close(); return str; } </SCRIPT> <DIV id=showText class=show style=margin-left:50;margin-right:50;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show onClick="showText.innerHTML=testReading()">ÀÛ¼ºµÈ ÈÀÏ Àбâ</DIV>
<SCRIPT> function DriveColletion(){ if (!fso) initialize(); str='<DIV class=title>Ä÷º¼Ç(collection) Á¤º¸</DIV>'; var Drives=fso.Drives; str+='<DL><DT>µå¶óÀÌºê ¼ö : ÃÑ '+Drives.Count+' °³'+br; enumObj=new Enumerator(Drives); for (; !enumObj.atEnd();enumObj.moveNext()){ str+='<DD>'+enumObj.item()+br; } str+='</DL>'; checkkey='C:'; str+='Drives.Item("'+checkkey+'")='+Drives.Item(checkkey)+br; str+='Drives.Item("'+checkkey+'").DriveLetter='+Drives.Item(checkkey).DriveLetter+br; str+='Drives.Item("'+checkkey+'").Path='+Drives.Item(checkkey).Path+br; str+='Drives.Item("'+checkkey+'").VolumeName='+Drives.Item(checkkey).VolumeName+br; return(str); } function CollectionListing(folderPath){ var foldersCol,enumObj if (!fso) initialize(); str='<DIV class=title>Ä÷º¼Ç(collection) Á¤º¸</DIV>'; if (!fso.FolderExists(folderPath)) return '³»¿ëÀÌ ¾øÀ¸´Ï <A href=#starting>ÀÌ°÷À» ¼öÇà</A>ÇÏ°í ÇØ º¸¶ó.'; foldersCol=fso.GetFolder(folderPath); enumObj=new Enumerator(foldersCol.Files); str+='<DL><DT>"'+folderPath+'" Æú´õÀÇ ÆÄÀϼö ÃÑ '+foldersCol.Files.Count+' Files'; for (; !enumObj.atEnd();enumObj.moveNext()){ str+='<DD>'+enumObj.item(); } str+='</DL>'; checkkey='testFile.txt'; if(fso.FileExists(folderPath+'\\'+checkkey)) str+='foldersCol.Files.Item("'+checkkey+'")='+foldersCol.Files.Item(checkkey)+br; enumObj=new Enumerator(foldersCol.SubFolders); str+='<DL><DT>"'+folderPath+'" Æú´õÀÇ ÇÏÀ§ Æú´õ¼ö ÃÑ '+foldersCol.SubFolders.Count+' Folders'; for (; !enumObj.atEnd();enumObj.moveNext()){ str+='<DD>'+enumObj.item()+br; } str+='</DL>'; checkkey='test'; if(fso.FolderExists(folderPath+'\\'+checkkey)) str+='foldersCol.SubFolder.Item("'+checkkey+'")='+foldersCol.SubFolders.Item(checkkey)+br; str+='foldersCol.SubFolder.Item("'+checkkey+'").Name='+foldersCol.SubFolders.Item(checkkey).Name+br; return(str); } </SCRIPT> <DIV id=showCollection class=show style=margin-left:20;margin-right:20;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show style=width:300 onClick="showCollection.innerHTML=DriveColletion()">Drives Ä÷º¼Ç º¸±â</DIV> <DIV class=show style=width:300 onClick="showCollection.innerHTML=CollectionListing('C:\\JsTest')">C:\\JsTest Ä÷º¼Ç º¸±â</DIV> <DIV class=show style=width:300 onClick="showCollection.innerHTML=CollectionListing('C:\\JsTest\\test')">C:\\JsTest\\test Ä÷º¼Ç º¸±â</DIV> <DIV class=show style=width:300 onClick="showCollection.innerHTML=CollectionListing('C:\\My Documents')">C:\\My Documents Ä÷º¼Ç º¸±â</DIV> <DIV class=show style=width:300 onClick="showCollection.innerHTML=CollectionListing('C:\\Program Files')">C:\\Program Files Ä÷º¼Ç º¸±â</DIV> </PRE>
<SCRIPT> function driveListing(){ if (!fso) initialize(); str='<DIV class=title>Drive Á¤º¸</DIV>'; var Drive; var Drives=fso.Drives; str+='<TABLE border=1>'+tr+'<TH colspan=10>'; str+='µå¶óÀÌºê ¼ö : '+Drives.Count+etd+etr; // Table HeadingÀ» ±¸¼ºÇÑ´Ù. str+='<TR style=background:eeeeee;text-align:center>'; str+=td+'Drive'; str+=td+'°æ·Î'; str+=td+'Á¾·ù'; str+=td+'Áغñ?'; str+=td+'À̸§'; str+=td+'ü°è'; str+=td+'Àüü¿ë·®'; str+='<TD colspan=2>»ç¿ë °¡´ÉÇÑ ¿ë·®(KB)'; str+=td+'ÀϷùøÈ£'+etd+etr; str+='<TR class=property style=font-size:90%;text-align:center>'; str+=td+'Letter'; str+=td+'Path'; str+=td+'Type'; str+=td+'Ready?'; str+=td+'Name'; str+=td+'System'; str+=td+'TotalSize'; str+=td+'Free'; str+=td+'Available'; str+=td+'Number'+etr; enumObj=new Enumerator(fso.Drives); for (; !enumObj.atEnd();enumObj.moveNext()){ str2=tr; Drive=enumObj.item(); str2+=td+Drive.DriveLetter; str2+=td+Drive.Path; str2+=td+ShowDriveType(Drive.DriveType); str2+=td+Drive.IsReady; if (Drive.IsReady){ str2+=td if (DriveTypeNetwork==Drive.DriveType){ str2+=Drive.ShareName; } else { str2+=Drive.VolumeName; } str2+=td+Drive.FileSystem; str2+=td+(Drive.TotalSize/1024/1024).toFixed(2)+' MB'; str2+=td+(Drive.FreeSpace/1024/1024).toFixed(2); str2+=td+(Drive.AvailableSpace/1024/1024).toFixed(2); str2+=td+Drive.SerialNumber.toString(16); } else str2+='<TD colspan=7 align=center>Áغñ°¡ µÇ¾î ÀÖÁö ¾ÊÀ½.'; str2+=etr; str+=str2; } str+='</TABLE>'; return str; } function ShowDriveType(type){ tmp='¾Ë ¼ö ¾øÀ½'; if (type==1) tmp='À̵¿½Ä'; //Removable: if (type==2) tmp='°íÁ¤½Ä'; //Fixed: if (type==3) tmp='³×Æ®¿öÅ©'; //Network: if (type==4) tmp='CD-ROM'; //CDROM: if (type==5) tmp='RAM µð½ºÅ©'; //RAMDisk: return tmp; } </SCRIPT> <DIV id=showDrives class=show style=margin-left:20;margin-right:20;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show onClick=showDrives.innerHTML=driveListing()>µå¶óÀÌºê ¿ä¾à º¸±â</DIV>
<SCRIPT> function showAllList(Folder){ if (!fso) initialize(); str+='<DIV class=title>¿¹Á¦ Folder, File Á¡°Ë</DIV>'; var TestFolder; if (!fso.FolderExists(Folder)){ str+=Folder+' ¾ø´Ù.'+br; return str; } MFolder=fso.GetFolder(Folder); str+=FolderList(MFolder); return str; } function FolderList(Folder){ var onestr=str2=''; FoldersCol=fso.GetFolder(Folder); SubFolders=FoldersCol.SubFolders; Files=FoldersCol.Files; onestr+=folderSummary(Folder); onestr+=FileList(Folder); if (SubFolders.Count){ onestr+=folderHeading+showProperty(MFolder); enumSObj=new Enumerator(SubFolders); for (; !enumSObj.atEnd();enumSObj.moveNext()){ SFolder=enumSObj.item(); onestr+=FileList(SFolder); onestr+=folderHeading+showProperty(SFolder); } onestr+='</TABLE>'; } else return return onestr; } function FileList(Folder){ var onestr=''; FoldersCol=fso.GetFolder(Folder); SubFolders=FoldersCol.SubFolders; Files=FoldersCol.Files; if (Files.Count){ onestr+='<TABLE border=1 width=100% bgcolor=eeffff class=middle>'; onestr+='<TR bgcolor=eeeeee style=text-align:center>'+td+'°æ·Î'+td+'À̸§'; onestr+=td+'Ư¼º'+td+'Å©±â'+td+'Á¾·ù'+etr; enumObj=new Enumerator(Files); for (; !enumObj.atEnd();enumObj.moveNext()){ File=enumObj.item(); onestr+=showProperty(File); } onestr+='</TABLE>'; } return onestr; } function folderSummary(Folder){ var onestr=''; FoldersCol=fso.GetFolder(Folder); SubFolders=FoldersCol.SubFolders; Files=Folder.Files; onestr+=Folder+'¿¡´Â ÆÄÀÏÀÌ '+Files.Count+'°³ ÀÖ°í,'; onestr+=' ÇÏÀ§ Æú´õ°¡ '+SubFolders.Count+'°³ ÀÖ´Ù. '+br; return onestr; } function showProperty(obj){ // obj´Â File, ȤÀº FolderÀÌ´Ù. tmp=tr+td; if (obj.Type=='ÆÄÀÏ Æú´õ'){ FoldersCol=fso.GetFolder(obj); SubFolders=FoldersCol.SubFolders; Files=obj.Files; if ((SubFolders.Count)&&(obj!=MFolder)){ folderobj=obj.Path.replace(/\\/gi,'\\\\'); tmp+='<A onClick=str="";showTree.innerHTML=showAllList("'+folderobj+'")'; tmp+=' style="boder:solid 1 blue;background:fdd" href=#listAll>'+folderobj+'</A>'; } else tmp+=obj.Path; tmp+=td+SubFolders.Count; tmp+=td+Files.Count; } else tmp+=obj.Path; tmp+=td+'<B>'+obj.Name+'</B>'; tmp+=td+showAttrib(obj); tmp+=td+obj.Size; tmp+=td+obj.Type; tmp+='<TR><TD colspan=8><TABLE class=small width=90% align=right border=0>'; tmp+=tr+td+'ÀÛ¼ºÀÏ:'+td+obj.DateCreated; tmp+=td+'ÃÖÁ¾Á¢¼ÓÀÏ:'+td+obj.DateLastAccessed; tmp+=td+'ÃÖÁ¾¼öÁ¤ÀÏ:'+td+obj.DateLastModified+'</TABLE>'+etr; return tmp; } function showAttrib(obj){ // obj´Â File, ȤÀº FolderÀÌ´Ù. var Attr=obj.Attributes; var tmp='<SMALL>'; if (Attr==0){ tmp='Normal'; } else { if (AttrDirectory==Attr) tmp+='µð·ºÅ͸®'; if (AttrReadOnly==Attr) tmp+='Àбâ Àü¿ë'; if (AttrHidden==Attr) tmp+='¼û±è'; if (AttrSystem==Attr) tmp+='½Ã½ºÅÛ'; if (AttrVolume==Attr) tmp+='º¼·ý'; if (AttrArchive==Attr) tmp+='º¸°ü'; if (AttrAlias==Attr) tmp+='º°Äª'; if (AttrCompressed==Attr) tmp+='¾ÐÃà'; } tmp+='</SMALL>'; return tmp; } </SCRIPT> <DIV id=showTree class=show style=margin-left:10;margin-right:10;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show onClick="str='';showTree.innerHTML=showAllList(TestFolderPath)">Æú´õ º¸±â ¿¹Á¦</DIV>
ÀÛ¾÷ ¿Ï·áÈÄ ÆÄÀÏ°ú Æú´õ¸¦ Á¤¸®ÇÏ¿© Áö¿î´Ù. ´Ù½Ã ÀÛ¾÷ÇÏ·Á¸é¿¹Á¦ Áغñ¿¡¼ »ý¼ºÇÒ ¼ö ÀÖ´Ù.
<SCRIPT> function testEnding(){ if (!fso) initialize(); str='<DIV class=title>¿¹Á¦¿¡¼ »ç¿ëµÈ Folder, File »èÁ¦</DIV>'; // ÆÄÀÏÀ» »èÁ¦ÇÏ´Â µÎ °¡Áö ¹æ¹ý: delPath=TestFolderPath+'\\testSub\\textFileB1.txt'; if(!fso.FileExists(delPath)){ str+='"'+delPath+'" FileÀÌ ¾ø¾î »èÁ¦ÇÒ ¼ö ¾ø´Ù.'+br; } else { str+=delPath+'°¡ »èÁ¦µÇ¾ú´Ù.'+br; fso.DeleteFile(delPath); } delPath=TestFolderPath+'\\textFileA.txt'; if(!fso.FileExists(delPath)){ str+='"'+delPath+'" FileÀÌ ¾ø¾î »èÁ¦ÇÒ ¼ö ¾ø´Ù.'+br; } else { str+=delPath+'°¡ »èÁ¦µÇ¾ú´Ù.'+br; File=fso.GetFile(delPath); File.Delete(); } // Æú´õÀ» »èÁ¦ÇÏ´Â µÎ °¡Áö ¹æ¹ý: delPath=TestFolderPath+'\\testSub'; if(!fso.FolderExists(delPath)){ str+='"'+delPath+'" Folder°¡ ¾ø¾î »èÁ¦ÇÒ ¼ö ¾ø´Ù.'+br; } else { str+=delPath+'°¡ »èÁ¦µÇ¾ú´Ù.'+br; fso.DeleteFolder(delPath); } delPath=TestFolderPath; if(!fso.FolderExists(delPath)){ str+='"'+delPath+'" Folder°¡ ¾ø¾î »èÁ¦ÇÒ ¼ö ¾ø´Ù.'+br; } else { str+=delPath+'°¡ »èÁ¦µÇ¾ú´Ù.'+br; TestFolder=fso.GetFolder(delPath); TestFolder.Delete(); } return str; } </SCRIPT> <DIV id=showEnd class=show style=margin-left:20;margin-right:20;width:100%>°á°ú Ç¥½ÃÀå</DIV> <DIV class=show onClick=showEnd.innerHTML=testEnding()>¿¹Á¦¿¡¼ »ç¿ëµÈ ÆÄÀÏ, Æú´õ »èÁ¦</DIV>