pId = Shell(strCmdLine, vbHide) ' Shell 传回 Process Id
pHnd = OpenProcess(SYNCHRONIZE, 0, pId) ' 取得 Process Handle
If pHnd <> 0 Then
Call WaitForSingleObject(pHnd, INFINITE) ' 无限等待,直到程序结束
Call CloseHandle(pHnd)
End If 作者: todaynew 时间: 2010-10-16 18:55
基本解决了,是引号问题。作者: todaynew 时间: 2010-10-16 20:04 本帖最后由 todaynew 于 2010-10-16 20:14 编辑
Function 压缩文件(RARname As String, filname As String)
'功能:压缩文件
'参数:RARname---压缩文件名(含路径),filname---被压缩的文件名或文件夹名(含路径)
'示例:压缩文件 CurrentProject.Path & "\备份\后台备份.rar",CurrentProject.Path & "\备份\*.mdb"
Call Shell("C:\Program Files\WinRAR\WinRAR.exe a -ep -df """ & RARname & """ """ & filname & """", vbNormalFocus)
End Function