2 u012637537 u012637537 于 2014.10.16 08:44 提问

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

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

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

1个回答

caozhy
caozhy   Ds   Rxr 2014.11.19 04: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

Csdn user default icon
上传中...
上传图片
插入图片