例如:
有一个文件是run.exe,我将其他更名为run.x86,如何让VB直接执行run.x86这个文件呢?我经常看到taskmgr里有一些执行程序都是xxx.dat之类的,不知道如何办到。望赐教,万分感激。
有一个文件是run.exe,我将其他更名为run.x86,如何让VB直接执行run.x86这个文件呢?我经常看到taskmgr里有一些执行程序都是xxx.dat之类的,不知道如何办到。望赐教,万分感激。
解决方案 »
- 为什么用winsock控件连续发数据发到1000多次时就会变慢?
- 检测软驱的问题,请各位高手帮忙!
- 写库遇到问题,高手请进.
- 用tcp协议 服务器端如何向多个客户同时发送数据?
- 用鼠标可以在QQ界面上点击"查找",可以找到"看看谁在线",但是用SPY++竟然无法找到"查找"究竟是哪一种类,请教究竟是怎么回事?
- ★★★★★急:请问怎样改变MDI窗体的标题栏,就像XP风格那样?
- 如何固定FORM.???不能拖大和最大化???
- 大虾快帮忙:error:49的含义?在线等
- 问如何给FROM1的菜单增加背景图片!
- 目不转睛地在此等待,盼着有人回复我的问题,着急呀!
- 如何改变第3方程序中的下拉框的数据改变
- 用instr函数搜索一个带日文的字符时提示溢出,请教
Public 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
Private Sub Command1_Click()
rt = ShellExecute(Me.hwnd, "open", "C:\run.x86", "", "", SW_SHOWNORMAL)
End Sub
Option ExplicitPrivate Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Byte
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" ( _
ByVal lpApplicationName As String, _
ByVal lpCommandLine As String, _
ByVal lpProcessAttributes As Long, _
ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, _
ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, _
ByVal lpCurrentDriectory As String, _
lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As LongPrivate Sub Command1_Click()
Dim lRet As Long, Si As STARTUPINFO, Pi As PROCESS_INFORMATION
Si.cb = LenB(Si)
lRet = CreateProcess("d:\notepad.xls", vbNullString, 0&, 0&, 0&, 0&, 0&, vbNullString, Si, Pi)
Debug.Print lRet; Err.LastDllError
End Sub
收分走人............
程序里是通过文件头来判断的