Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos
来源:互联网 发布:数据图表制作软件 编辑:程序博客网 时间:2024/04/27 21:25
http://stackoverflow.com/questions/11708779/exec-vs-execwait-vs-execshell-vs-nsexecexec-vs-nsexecexectolog-vs-nsexecex
Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos vs ExeCmd
Can I know what are the differences between each Exec, ExecWait, ExecShell, nsExec::Exec, nsExec::ExecToLog, nsExec::ExecToStack, ExecDos and ExecCmd, as in when to use which?
I 've posted the various execute calls I know. I am trying to make a comprehensive list, so that it helps future visitors..
Exec
: Plainly execute the called string, be it some application, console or file.ExecWait
: Executes likeExec
but waits till the process exits.ExecShell
: What is it for?nsExec::Exec
: Just likeExec
orExecWait
but only for command prompt and that too without opening the console window. I am unsure if it waits for process to exit. DoesnsExec::Exec
wait for child process to exit?nsExec::ExecToLog
:The documentation says ExecToLog
is similar to plainnsExec
but it outputs to log window. What does that mean, what is a log window?nsExec::ExecToStack
: The documentation saysExecToStack
is similar to plainnsExec
but it pushes output to stack. I get that.ExecDos
: Same asnsExec::ExecToStack
but it additionally (Is it not?)a. takes string parameter that serves as stdin for running application.
b. works in both sync/async mode.
c. it works out of section - for .onInit check outs.
ExecCmd
: Same asExecDos
but it doesn't require theseExpandEnvStrings $3 %COMSPEC% ExecDos::exec /C
parts. Am I correct?
1 Answer
1) 2) 3)
Exec
and ExecWait
use CreateProcess internally and can only start programs and batch files.
ExecShell
uses ShellExecute which means that it can also launch any registered filetype (.txt .chm etc) and URLs. It should also be used if the program you are starting needs to elevate with UAC.
4)
nsExec redirects stdout so a console window is not visible when the child process executes. And yes, it waits.
5)
The log window on the instfiles page.
7)
Yes, both ExecDos and ExecCmd are more advanced versions of nsExec.
8)
Correct
- Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos
- source VS exec
- > VS >
- VS
- vs
- vs
- &&VS&
- VS
- vs
- VS
- VS
- find -exec cmd {} + vs | xargs
- VIM vs VS:关公战秦琼
- 【VS Hacks】定制VS
- Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Membase vs Neo4j comparison
- Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Membase vs Neo4j comparison
- Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Membase vs Neo4j comparison
- Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Couchbase vs Neo4j vs Hypertable vs Ela
- 20150129 N2 成绩133 合格!
- Java解析Properties文件
- 分布式图鉴
- MFC 学习之 对话框添加菜单详细步骤
- FreeBSD 让普通用户使用su 获得root权限
- Exec vs ExecWait vs ExecShell vs nsExec::Exec vs nsExec::ExecToLog vs nsExec::ExecToStack vs ExecDos
- 600多个iOS开源项目分类及介绍
- 关于< meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />
- xml入门
- ubuntu eclipse 如何新建web项目
- jquery的版本历史
- Android Studio常见问题
- Largest Number
- Java 复制文件夹所有内容到另一个文件夹