用 filecopy 命令来执行

解决方案 »

  1.   

    FileCopy 光盘文件路径及文件名,硬盘路径
      

  2.   

    'This program needs a Common Dialog Box, named CDBox.
    '  (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
    '   and select Microsoft Common Dialog control)
    Private Type SHFILEOPSTRUCT
        hWnd As Long
        wFunc As Long
        pFrom As String
        pTo As String
        fFlags As Integer
        fAborted As Boolean
        hNameMaps As Long
        sProgress As String
    End Type
    Private Const FO_DELETE = &H3
    Private Const FOF_ALLOWUNDO = &H40
    Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
    Private Sub Form_Load()
        'KPD-Team 1998
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Dim SHFileOp As SHFILEOPSTRUCT
        'Set the dialog's title
        CDBox.DialogTitle = "Select a file to delete ..."
        'Set the dialog's filter
        CDBox.Filter = "All Files (*.*)|*.*"
        'Show the 'Open File' dialog
        CDBox.ShowOpen
        With SHFileOp
            'Delete the file
            .wFunc = FO_DELETE
            'Select the file
            .pFrom = CDBox.filename
            'Allow 'move to recycle bn'
            .fFlags = FOF_ALLOWUNDO
        End With
        'perform file operation
        SHFileOperation SHFileOp
        MsgBox "The file '" + CDBox.filename + "' has been moved to your Recycling Bin !", vbInformation + vbOKOnly, App.Title
    End Sub
      

  3.   

    filecopy (Richtx32.ocx,C:\WINDOWS\SYSTEM)
    语法错在哪里?
      

  4.   

    当你要将此filecopy的返回值赋给一个变量时才需要括号,一般函数才有返回值,过程没有。
      

  5.   

    G:\abc\  光盘 
    C:\  硬盘
    filecopy "G:\abc\Richtx32.ocx","C:\WINDOWS\SYSTEM\Richtx32.ocx"
      

  6.   

    最好用FSO
       用copy方法,这在msdn中有说明