我突然想到一件事,大多数的win应用程序,如Windows版本(winver), calc和所有的可执行文件,将在那里在Windows或System32文件夹
像这样,运行命令,我们正在使用的Win+R快捷方式也可执行文件?在Windows系统文件夹的任何地方都可以作为可执行文件吗?
当我尝试点击打开文件位置时,它正在打开桌面。当我们点击快捷键时从哪里开始呢?
不,它不是exe,它是一个shell对话框窗口,您可以在动态链接库C:WindowsSystem32shell32.dll
中找到你可以在VBScript中像这样调用它:
dim objShell
set objShell = CreateObject("shell.application")
objShell.FileRun
从JScript如下:
var objShell = new ActiveXObject("shell.application");
objShell.FileRun();
从VB6这样:
Private Sub fnShellFileRunVB()
Dim objShell As Shell
Set objShell = New Shell
objShell.FileRun
Set objShell = Nothing
End Sub
与现代VB。. NET,这变成:
Dim t2 As Type = Type.GetTypeFromProgID("Shell.Application")
Dim obj2 = Activator.CreateInstance(t2) ' dynamic
obj2.FileRun()
如果option strict是"ON",那么应该这样做:
Dim t As Type = Type.GetTypeFromProgID("Shell.Application")
Dim obj As Object = Activator.CreateInstance(t)
t.InvokeMember("FileRun", System.Reflection.BindingFlags.InvokeMethod, Nothing, obj, Nothing)
c#变体:
Type t = Type.GetTypeFromProgID("Shell.Application");
object obj = Activator.CreateInstance(t);
t.InvokeMember("FileRun", System.Reflection.BindingFlags.InvokeMethod, null, obj, null);
//If the C # 4.0, the Dynamic Lookup presence of, it can be:
Type t2 = Type.GetTypeFromProgID("Shell.Application");
dynamic obj2 = Activator.CreateInstance(t2);
obj2.FileRun();
但是你也可以从批处理文件中调用它,如果你愿意的话:
C:WINDOWSsystem32rundll32.exe shell32.dll,#61
或通过浏览器命令行:
explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}