VisualStudio/C#

[C#서버][방법] 배치(bat)파일 사용 방법 Main(string[] args) args 인자 값 만들기

usingsystem 2022. 11. 1. 15:06
728x90

bat파일 만드는 방법

새로 만들기 -> 메모장 생성 -> 확장자명 .bat로 변경

1. START명령어를 사용하여 exe 실행 자동화

 

2. exe뒤에 ../../.......은  Main(string[] args) args의 인자값을 생성하는 부분

 

3. XCOPY /Y GenPackets.cs "../../DummyClient/Packet"

XCOPY - 파일을 복사하여 다른 폴더에 저장하기 위해사용

/Y - 이미 파일이 존재한다면 덮어쓰기

 

protoc.exe -I=./ --csharp_out=./ ./Protocol.proto 
IF ERRORLEVEL 1 PAUSE

START ../../../Server/PacketGenerator/bin/PacketGenerator.exe ./Protocol.proto
XCOPY /Y Protocol.cs "../../../Client/Assets/Scripts/Packet"
XCOPY /Y Protocol.cs "../../../Server/Server/Packet"
XCOPY /Y ClientPacketManager.cs "../../../Client/Assets/Scripts/Packet"
XCOPY /Y ServerPacketManager.cs "../../../Server/Server/Packet"
728x90