4
Answers

why not run my batch file in C# as service?

Zoltan Foldi

Zoltan Foldi

2w
226
1

the batch esential is the folowing line

sqlcmd -S DESKTOP-4TQK0H9\SQLEXPRESS -U %Username% -P %Password% -d %Database% -Q "BACKUP DATABASE %Database% TO  DISK = '%BaseFolderPath%\%Database%.bak' WITH NOFORMAT, INIT, SKIP, NOREWIND, NOUNLOAD,  S

in another normal winform batch file is running withoout problem.

Answers (4)