在桌面上创建文件文本文件RunFile.vb
。
将其粘贴到它。
Imports System
Imports System.Runtime.InteropServices
Imports Microsoft.Win32
Public Module MyApplication
Sub Main()
Dim X as Object
X = CreateObject("wscript.shell")
X.Run("c:\windows\notepad.exe")
End Sub
End Module
制作节目类型此
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc.exe" /target:winexe /out:"%userprofile%\desktop\RunFile.exe" "%userprofile%\desktop\RunFile.vb" /verbose
X.Run
可以是任何东西,你可以键入开始运行对话框(WINKEY + R)
帮助窗口查找程序和文档
可以将程序和文档添加到注册表中,以便在不使用路径的情况下输入其名称在“开始 - 运行”对话框或快捷方式中,Windows将找到它们。
这是一个通用的reg文件。将下面的行复制到一个新的文本文档并将其保存为anyname.reg。用您的程序或文档编辑它。
在路径中使用\来分隔键路径中的文件夹名称,因为注册表使用单个\来分隔键名称。所有reg文件都以REGEDIT4开头。分号将一行变成注释。 @符号表示将值分配给键而不是命名值。
该文件不一定存在。这可以用来设置Word.exe来打开Winword.exe。 或者通过注册一个不存在的website.exe来指向website.html,只需输入网站即可打开website.html。
此示例将IE.Txt(从IE5)添加到注册表,因此键入IE.Txt将打开它。我认为该文件在IE4中被称为IE4.txt。 REGEDIT4 ;下面的粗体名称是文档或程序的名称。
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IE.txt]
;The @ means the path to the file is assigned to the default value for the key.
;The whole path in enclosed in a quotation mark ".
@="\"C:\\Program Files\\Internet Explorer\\IE.txt\""
;Optional Parameters. The semicolon means don't process the line. Remove it if you want to put it in the registry
;Informs the shell that the program accepts URLs.
;"useURL"="1"
;Sets the path that a program will use as its' default directory. This is commented out.
;"Path"="C:\\Program Files\\Microsoft Office\\Office\\"
更新:出于某种原因,它在我选择“可见应用程序”时不起作用,并且不在编译器中使用图标。 –
Bat-to-Exe转换器是垃圾,从不使用它们。 – SomethingDark
是的,我同意。有没有其他方法可以做到这一点?我只想要一个文件,您可以双击打开我的相对链接,并带有图标。 –