I trying to create a bat file using csharp which contains some commands.
So which is the best place to keep this commands so that I can fetch it while creating the batch file? It is ok to keep it inside a string variable? See below the sample commands that I need to keep inside the bat file.
@echo off
set seconds=45
echo Waiting to start...
….etc
Edit: The contents of the bat file are static one, it never changes.
Any help much appreciated, Thanks
Depending on how dynamic your batch file contents will be, it would be fine to use strings to store the contents. I recommend using the
StringBuilderclass to build out your batch file.If your batch file contents are static, it might be better to store the file as a resource in your application.