I forgot the file I need to download which though outdated, has a lot of
the Win32 functions. It was win32.hlp or something like that.

I would like to make this to where it can read in a text file with
additional file names to copy.

Thanks.

; copyf.asm  Copy a file over an existing file
;           

.486                     
    .model flat, stdcall      ; 32 bit memory model
    option casemap :none      ; case sensitive


    include \masm32\include\windows.inc
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\Comctl32.inc
    include \masm32\include\comdlg32.inc
    include \masm32\include\shell32.inc
    include \masm32\include\oleaut32.inc
    include \masm32\macros\macros.asm

    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\Comctl32.lib
    includelib \masm32\lib\comdlg32.lib
    includelib \masm32\lib\shell32.lib
    includelib \masm32\lib\oleaut32.lib

.data

      File1 db "Q:\LabSupplies\lab_order.xls", 0 ; file names are case sensitive
      File2 db "C:\spare\lab_order.xls", 0

.code

start:

main proc

    LOCAL buffer[260]:BYTE
    invoke GetCL,1,ADDR buffer

    ; Specifies how this operation is to proceed if a file of the same
    ; name as that specified by lpNewFileName already exists.
    ; If this parameter is TRUE and the new file already exists,
    ; the function fails. If this parameter is FALSE and the new file
    ; already exists, the function overwrites the existing file and succeeds.                 

    invoke CopyFile, offset File1, offset File2, FALSE
    invoke ExitProcess,0

main endp

end start
Posted on 2005-12-14 07:48:58 by skywalker