vbscript - Read Exit Code from VBS Script through Process in C# -


i'm calling vbs-script c# console application using process class.

process script = process.start("cscript", arguments); script.waitforexit() int exitcode = script.exitcode; 

now want able feedback script tell if got through without problems.

i call script using "cscript //b //nologo \path\to\script.vbs" process class. in script, want able return feedback or raise kind of error when database entry not found example.

i found out can return error codes using wscript.quit(int)

the problem cscript seems return other 0 when can't find file. if file found, process.exitcode 0 when use wscript.quit(1) in script.

is there way exit code script or way communicate c# application?


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -