从dll文件调用cmd文件 [英] Invoking cmd file from dll file

查看:130
本文介绍了从dll文件调用cmd文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从dll调用cmd文件。我知道这是可能的。任何人都可以告诉我代码。我正在使用 Visual Studio 2008

I wanna invoke cmd file from dll.I know it is possible. can anyone tell me the code. am using Visual studio 2008

推荐答案

Process Class具有您可以设置的属性。查看文档以查看是否要设置其中任何一个。

The Process Class has properties that you can set. Review documentation to see if you want to set any of them.
Imports System.Diagnostics







Dim myProcess As New Process
Try
    myProcess.StartInfo.FileName = Environment.GetFolderPath( _
        Environment.SpecialFolder.System) & _
        "\cmd.exe"
    myProcess.Start()
Catch ex As Exception
    MsgBox(String.Concat(ex.Message, vbNewLine, vbNewLine, _
         "Unable to Start: cmd.exe"), _
         MsgBoxStyle.Critical, "Starting CMD.EXE")
End Try


这篇关于从dll文件调用cmd文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆