试试下面
Shell "c:\windows\Command.com /k copy /b filename1+filename2 filename3", vbNormalFocus
Shell "c:\windows\Command.com /k copy /b filename1+filename2 filename3", vbNormalFocus
解决方案 »
- 请问ACCESS.ListBox如何对其中的item排序
- 有关的zip压缩文件的问题LiteZip and LiteUnzip
- PDFLib里画出的矩形怎么填充色总是黑色?
- 超酷的数据库问题,请高手赐教
- 【问】如何取得WebBrower控件当前页面的全部实际源码?(含回车换行字符)
- 怎样使新form显示在所有form的最前端?
- 请教使用加密狗加密程序的原理是什么?
- 请问VB中AddressOf是什么意思?它的意思是什么呢???
- GetObject 搞了一天都没有搞明白,神经兮兮的
- 向API高手请教!
- 为什么在VB中win2000和win98中的设备映射模式有区别
- 怎样使图片变灰,如:toolbar中的按钮Enabled为False时图片效果?
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) _
As LongShellExecute 0, "Open", "c:\windows\Command.com /k copy /b filename1+filename2 filename3" , "", "C:\", 1
Sub MyFileCopy(sFileName0 As String, sFilename As String, Optional N As Long = 0)
'当 N=0时 ,即 为 Copy
Const KB = 1024
Dim nKB As Long
nKB = 64
Dim FileBuffer() As Byte
Dim FileNumberS As Long
Dim FileNumberT As Long
Dim lFileLen As Long
lFileLen = FileLen(sFileName0) - N
FileNumberS = FreeFile
Open sFileName0 For Binary Access Read As #FileNumberS
FileNumberT = FreeFile
Open sFilename For Binary Access Write As #FileNumberT
ReDim FileBuffer(1 To (nKB * KB)) As Byte '设 置 缓 冲 区 大 小 为 64K
'若 用 Do Until LOF(FileNumber)
' ...
' Loop 语 句 ,
'不 方 便 ,复 杂 !
Do While lFileLen >= (nKB * KB)
Get #FileNumberS, , FileBuffer
Put #FileNumberT, , FileBuffer
lFileLen = lFileLen - (nKB * KB)
Loop
If lFileLen > 0 Then
ReDim FileBuffer(1 To lFileLen) As Byte
Get #FileNumberS, , FileBuffer
Put #FileNumberT, , FileBuffer
End If
Close #FileNumberS
Close #FileNumberT
MsgBox "End!"
End Sub
1.命令就是纯dos的命令
2.不出现DOS窗口
3.不能异步执行,这句还没执行完,就执行下面语句了
在http://wuf.yeah.net/有这三个问题的详细解决方案
有进一步的要求, 可向我索要另外的源码
例如:
If Len(mlm) <= 3 Or Right(mlm, 1) = "\" Then
MsgBox "目的目录不允许为根目录且不用加 \"
Text2.SetFocus
Exit Sub
End If
If Len(Trim(Dir(mlm, 16))) > 0 Then
Dim Response
SendKeys "{TAB}"
Response = MsgBox("目录 [" & mlm & "] 已存在,你确信删除吗?", vbYesNo, "【提醒】")
If Response = 6 Then
Shell "Command.com /C deltree.exe /y " & mlm, vbMinimizedNoFocus
Else
MsgBox "由于该目录已存在,程序停止传送文件!"
Exit Sub
End If
End If
Do While Len(Trim(Dir(mlm, 16))) > 0
Loop
MkDir (mlm)
http://210.77.145.209/dev/Visual%20Basic/source%20code/Executable%20File%20Related/Shell32.zip
I = Shell(winpath + "\Command.com /c copy /b /y sysdat2.mdb + sysdat1.mdb + sysdat3.mdb " + winsyspath + "\minitool.exe", vbHide)
p = OpenProcess(SYNCHRONIZE, False, I)
r = WaitForSingleObject(p, INFINITE)
r = CloseHandle(p)
...