一生有你_heart 2014-10-16 00:44 采纳率: 0%
浏览 1777

程序语言中使用 shell 怎么给其中参数传值呢

其中initprocessID 是PID 进程号,有没有知道呢?我这样写的不行啊,怎么修改呢?如下:

Shell "cmd.exe /c taskkill -pid initprocessID /f", vbHide
我用的是VB 写的,求指教,谢谢!

  • 写回答

1条回答

  • threenewbee 2014-11-18 20:26
    关注

    可以用ShellExecute API
    Public Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" _
    (ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

    ShellExecute 0, "open", "cmd.exe", "/c taskkill -pid initprocessID /f", App.Path, 0

    评论

报告相同问题?

悬赏问题

  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp