Copy files in Pb

Source: Internet
Author: User

 

Method 1:
① Define API:
Function ulong copyfile (ref string lpexistingfilename, ref string lpnewfilename, ulong bfailifexists) Library kernel32.dll "alias for" copyfilea"
Note: copy an object.
Returned value: ulong. If the value is not zero, the operation is successful. If the value is zero, the operation fails.
Parameter type and description
Lpexistingfilename string, source file name.
Lpnewfilename string, the target file name.
Bfailifexists ulng. If it is set to true (non-zero), function call fails once the target file already exists. Otherwise, the target file is rewritten.
② Script:
String str_source, str_des
Ulong ulng_result
Str_source = "C:/lag.txt" // source file
Str_des = "C:/tmp/111.txt" // target file
Ulng_result = copyfile (str_source, str_des, 0)
If ulng_result <> 0 then
MessageBox ("OK", "file copied successfully! ")
End if

Method 2:
① First process a batch of files lag. BAT:
Copy C:/lag.txt C:/tmp/lll.txt
② InProgramTo call this batch of files:
Run ("lag. Bat ")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.