Scripting Runtime Library(FileSystemObject)

지정한 특정 폴더 개체를 반환한다.

Script[oHolder=]FileSystemObject.GetSpecialFolder(folderPath)
인수/파라메터
object

필수적인 object 참조는 항상 FileSystemObject의 이름이다.

folderPath
필수적인 요소이며, 특정 폴더의 이름을 설정하며, 아래 설정에 있는 상수이면 된다.
이름 설명
윈도우 폴더 WindowsFolder 0 Windows 폴더에는 Windows 운영 체제로 설치된 파일이 들어있다.
시스템 볼더 SystemFolder 1 System 폴더에는 라이브러리, 글꼴, 장치 드라이브가 들어있다.
임시 폴더 TemporaryFolder 2 Temp 폴더는 임시 파일들을 저장하는 데 사용된다. 그 경로는 TMP 환경 변수에 있다.
반환값

반환값 oHolder는 임시 파일이나 폴더의 이름을 참조하는 개체이다.


method
GetSpecialFolder 메서드
GetSpecialFolder</b> 메서드이전페이지로페이지 맨위로페이지 맨아래로

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>

method
GetSpecialFolder 메서드
견본
이전페이지로페이지 맨위로
최종 수정:
04/08/2025 22:31:57
KoXo Homepage
All right reserved
비정상적인 방식으로 프레임없이 페이지에 접속하면 자주 오류가 발생됩니다.
오류가 나면 정상적 접속으로 시도해 보세요.
http://koxo.com/lang/js/method/GetSpecialFolder.html