gpt4 book ai didi

windows - 如何使用 TideSDK 杀死一个 windows 应用程序?

转载 作者:可可西里 更新时间:2023-11-01 11:51:13 24 4
gpt4 key购买 nike

我正在尝试运行类似 TASKKILL/F/IM notepad.exe 的命令

var process = Ti.Process.createProcess({args: ['TASKKILL /F /IM notepad.exe']});
process.launch();

Ti.Process.launch('TASKKILL /F /IM skype.exe');

调试器没有说太多,只是Error launching 'TASKKILL/F/IM notepad.exe'

documentation

有什么想法吗?

最佳答案

为了创建流程,我使用了这种语法 (coffeeScript):

customProcess = Ti.Process.createProcess([
arg1
arg2
arg3
])
customProcess.launch()

这是我如何使用 Ti.Process 的示例:执行 wkhtmltopdf 二进制文件以从 HTML/CSS 创建 pdf。所以我使用以下内容:

pdfProcess = Ti.Process.createProcess([
Ti.API.application.getResourcesPath() + '/wkhtmltopdf/builds/win32/wkhtmltopdf/bin/wkhtmltopdf.exe'
'--margin-bottom'
30
'--margin-top'
40
sourcePath
'--header-html'
headerPath
'--footer-html'
footerPath
destinationPath
])
pdfProcess.launch()

我还没有尝试过,但也许以下方法会起作用:

exitProcess = Ti.Process.createProcess([
'TASKKILL'
'/F'
'/IM'
'notepad.exe'
])
exitProcess.launch()

我认为您必须将流程的每个参数拆分到列表的一个项目中。

关于windows - 如何使用 TideSDK 杀死一个 windows 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29199569/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com