Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ Æ¯Á¤ Æú´õ °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
object

ÇʼöÀûÀÎ object ÂüÁ¶´Â Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.

folderPath
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, ƯÁ¤ Æú´õÀÇ À̸§À» ¼³Á¤Çϸç, ¾Æ·¡ ¼³Á¤¿¡ ÀÖ´Â »ó¼öÀÌ¸é µÈ´Ù.
À̸§ °ª ¼³¸í
À©µµ¿ì Æú´õ WindowsFolder 0 Windows Æú´õ¿¡´Â Windows ¿î¿µ üÁ¦·Î ¼³Ä¡µÈ ÆÄÀÏÀÌ µé¾îÀÖ´Ù.
½Ã½ºÅÛ º¼´õ SystemFolder 1 System Æú´õ¿¡´Â ¶óÀ̺귯¸®, ±Û²Ã, ÀåÄ¡ µå¶óÀ̺갡 µé¾îÀÖ´Ù.
Àӽà Æú´õ TemporaryFolder 2 Temp Æú´õ´Â Àӽà ÆÄÀϵéÀ» ÀúÀåÇÏ´Â µ¥ »ç¿ëµÈ´Ù. ±× °æ·Î´Â TMP ȯ°æ º¯¼ö¿¡ ÀÖ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª oHolder´Â Àӽà ÆÄÀÏÀ̳ª Æú´õÀÇ À̸§À» ÂüÁ¶ÇÏ´Â °³Ã¼ÀÌ´Ù.


GetSpecialFolder ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript GetSpecialFolder ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=JScript>
function GetSpecialFolderTest(){
  var fso,tmpFolder,tmpFile,tmpName,tmpObj
  var WindowFolder=0;
  var SystemFolder=1;
  var TemporaryFolder=2;
  fso=new ActiveXObject('Scripting.FileSystemObject');
  str='À©µµ¿ì Æú´õ´Â "'+fso.GetSpecialFolder(WindowFolder)+'<BR>';
  str+='½Ã½ºÅÛ Æú´õ´Â "'+fso.GetSpecialFolder(SystemFolder)+'<BR>';
  str+='Àӽà Æú´õ´Â "'+fso.GetSpecialFolder(TemporaryFolder)+'<BR><BR>';

  tmpFolder=fso.GetSpecialFolder(TemporaryFolder);
  tmpName=fso.GetTempName();
  tmpFile=tmpFolder.CreateTextFile(tmpName);
  tmpFile.WriteLine('¿¹Á¦¸¦ À§ÇÑ È­ÀÏ ³»¿ëÀÌ´Ù.');
  tmpFile.Close();
  str+='Àӽà Æú´õ "'+tmpFolder+'"¿¡<BR>ÀÓ½ÃÆÄÀÏ "'+tmpFile+'"ÀÌ »ý¼ºµÇ¾ú´Ù.';
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showjs.innerHTML=GetSpecialFolderTest()">
  <SPAN class=ie>JScript</SPAN> <SPAN class=method>GetSpecialFolder</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>
°á°ú Ç¥½Ãâ
JScript GetSpecialFolder ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=VBScript>
Function GetSpecialFolderTestvb()
  Dim fso,tmpFolder,tmpFile,tmpName,tmpObj,str
  Const WindowFolder=0
  Const SystemFolder=1
  Const TemporaryFolder=2
  Set fso=CreateObject("Scripting.FileSystemObject")
  str="À©µµ¿ì Æú´õ´Â '"&fso.GetSpecialFolder(WindowFolder)&"'<BR>"
  str=str&"½Ã½ºÅÛ Æú´õ´Â '"&fso.GetSpecialFolder(SystemFolder)&"'<BR>"
  str=str&"Àӽà Æú´õ´Â '"&fso.GetSpecialFolder(TemporaryFolder)&"'<BR><BR>"

  Set tmpFolder=fso.GetSpecialFolder(TemporaryFolder)
  tmpName=fso.GetTempName
  Set tmpFile=tmpFolder.CreateTextFile(tmpName)
  'Set tmpFile=CreateTempFile
  tmpFile.WriteLine "¿¹Á¦¸¦ À§ÇÑ È­ÀÏ ³»¿ëÀÌ´Ù."
  tmpFile.Close
  str=str&"Àӽà Æú´õ '"&tmpFolder&"'¿¡<BR>ÀÓ½ÃÆÄÀÏ '"&tmpName&"'ÀÌ »ý¼ºµÇ¾ú´Ù."
  GetSpecialFolderTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showvb.innerHTML=GetSpecialFolderTestvb()">
  <SPAN class=ie>JScript</SPAN> <SPAN class=method>GetSpecialFolder</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>