Exec

出自ProgWiki
跳至導覽 跳至搜尋

Exec,執行外部程式,參照:『維基百科~Exec_(operating_system)

應用

.NET

ActiveX

ActiveX的用法常因為用於病毒或木馬的入侵管道(以VBScript或JavaScript去Call外部的exe檔),所以常被安全性設定或掃毒軟體所封鎖。

<script language="JScript">
    function fnShellExecute()
    {
        var objShell = new ActiveXObject("Shell.Application");
        objShell.ShellExecute("notepad.exe", "", "", "open", 1);
    }
</script>

C++

C#

Lua

Node.js

Perl

PHP

Python

Tcl

Windows API

ShellExecute
ShellExecuteEx
CreateProcess
CreateProcessAsUser

VB

Private 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
 
Const SW_SHOW = 5

VBA