WEB/트라우마 NCS_5

cmd로 .cs파일 컴파일하기(path)

함댕댕 2021. 10. 4. 08:15

디렉토리 저장할 폴더 cs라고 만들고 A001파일 안에 새로만들기 > 텍스트문서 > 저장할때 파일형식 모든파일로 하고 .cs인지 .txt 몰라서 둘다 만듬

 

 

C:\Users\1>cd \  //최상위 폴더로 이동 
C:\>dir /s csc.exe
 C 드라이브의 볼륨에는 이름이 없습니다.
 볼륨 일련 번호: 8008-38C7
 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn 디렉터리
2021-10-06  오전 11:46            58,232 csc.exe
               1개 파일              58,232 바이트
 C:\Windows\Microsoft.NET\Framework\v2.0.50727 디렉터리
2019-12-03  오후 02:04            80,296 csc.exe
               1개 파일              80,296 바이트
 C:\Windows\Microsoft.NET\Framework\v3.5 디렉터리
2019-12-03  오후 02:04         1,548,432 csc.exe
               1개 파일           1,548,432 바이트
 C:\Windows\Microsoft.NET\Framework\v4.0.30319 디렉터리
2019-12-07  오후 06:10         2,141,552 csc.exe
               1개 파일           2,141,552 바이트
 C:\Windows\Microsoft.NET\Framework64\v2.0.50727 디렉터리
2019-11-08  오후 02:44            91,256 csc.exe
               1개 파일              91,256 바이트
 C:\Windows\Microsoft.NET\Framework64\v3.5 디렉터리
2019-11-08  오후 02:44         2,290,808 csc.exe
               1개 파일           2,290,808 바이트
 C:\Windows\Microsoft.NET\Framework64\v4.0.30319 디렉터리
2019-12-07  오후 06:10         2,759,232 csc.exe
               1개 파일           2,759,232 바이트
 C:\Windows\WinSxS\amd64_netfx-csharp_compiler_csc_b03f5f7f11d50a3a_10.0.19041.1_none_77b40a18a99e4f02 디렉터리
2019-11-08  오후 02:44            91,256 csc.exe
               1개 파일              91,256 바이트
 C:\Windows\WinSxS\amd64_netfx35linq-csharp_31bf3856ad364e35_10.0.19041.1_none_cd1cbc8db3875f47 디렉터리
2019-11-08  오후 02:44         2,290,808 csc.exe
               1개 파일           2,290,808 바이트
 C:\Windows\WinSxS\amd64_netfx4-csc_exe_b03f5f7f11d50a3a_4.0.15805.0_none_76eb13d6387f99ed 디렉터리
2019-12-07  오후 06:10         2,759,232 csc.exe
               1개 파일           2,759,232 바이트
 C:\Windows\WinSxS\x86_netfx-csharp_compiler_csc_b03f5f7f11d50a3a_10.0.19041.1_none_bf6140efbe1a7808 디렉터리
2019-12-03  오후 02:04            80,296 csc.exe

               1개 파일              80,296 바이트
 C:\Windows\WinSxS\x86_netfx35linq-csharp_31bf3856ad364e35_10.0.19041.1_none_70fe2109fb29ee11 디렉터리
2019-12-03  오후 02:04         1,548,432 csc.exe
               1개 파일           1,548,432 바이트
 C:\Windows\WinSxS\x86_netfx4-csc_exe_b03f5f7f11d50a3a_4.0.15805.0_none_be984aad4cfbc2f3 디렉터리
2019-12-07  오후 06:10         2,141,552 csc.exe
               1개 파일           2,141,552 바이트
     전체 파일:
              13개 파일          17,881,384 바이트
               0개 디렉터리  162,400,944,128 바이트 남음 //csc.exe 파일 위치 조회 

C:\>path C:\Windows\Microsoft.NET\Framework\v3.5  //경로 아무거나 선택(난 짧은걸로)해서 path주기 

C:\>path
PATH=C:\Windows\Microsoft.NET\Framework\v3.5 //path확인 

C:\>cd \junglim\cs\A001 //디렉토리 만들어놓은 폴더로 이동 

C:\junglim\cs\A001>dir  //디렉토리 검색 
 C 드라이브의 볼륨에는 이름이 없습니다.
 볼륨 일련 번호: 8008-38C7

 C:\junglim\cs\A001 디렉터리

2021-10-06  오후 12:10    <DIR>          .
2021-10-06  오후 12:10    <DIR>          ..
2021-10-06  오후 12:10                91 dd.cs
2021-10-06  오후 12:09                91 dd.txt
               2개 파일                 182 바이트
               2개 디렉터리  162,374,262,784 바이트 남음

C:\junglim\cs\A001>csc.exe dd.cs //dd.cs파일을 컴파일해주세요
Microsoft (R) .NET Framework 버전 3.5용 Microsoft (R) Visual C# 2008 컴파일러 버전 3.5.30729.9141

Copyright (c) Microsoft Corporation. All rights reserved.


C:\junglim\cs\A001>dd.exe //확인
Hello, World