简体   繁体   English

从C#应用程序运行.WSF脚本文件?

[英]Running a .WSF script file from a C# application?

I'm completely stumped. 我完全迷住了。 Is there any way to have a .wsf script run via ac# application (Windows forum application)? 是否可以通过ac#应用程序(Windows论坛应用程序)运行.wsf脚本?

I believe you can use Process.Start to call the script host: 我相信您可以使用Process.Start来调用脚本主机:

string scriptFile = GetWsfFileNameWithPath();
System.Diagnostics.Process.Start("WScript.exe", "//B //Nologo " + scriptFile);

For details on the command line arguments, see TechNet's article on running scripts from the command line . 有关命令行参数的详细信息,请参阅TechNet上有关从命令行运行脚本的文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM