c# 执行vbs。.net执行vbs 电脑版发表于:2023/2/23 14:42 **代码如下:** ``` Process scriptProc = new Process(); scriptProc.StartInfo.FileName = @"C:\\text.vbs"; scriptProc.Start(); scriptProc.WaitForExit(); scriptProc.Close(); ``` **如果.net core 执行vbs 报错: The specified executable is not a valid application for this OS platform** 使用如下代码: ``` Process.Start(@"cmd.exe ", @"/c C:\Users\81517\Desktop\快捷访问服务器\wy.vbs"); ``` 还可以将ProcessStartInfo的UseShellExecute属性设置为true ``` var p = new Process(); p.StartInfo = new ProcessStartInfo(@"C:\Users\user2\Desktop\XXXX.reg") { UseShellExecute = true }; p.Start(); ```