Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

VB Copy Command

Original Message
Name: henry_joshua
Date: February 15, 2005 at 23:03:59 Pacific
Subject: VB Copy Command
OS: XP
CPU/Ram: p4,128
Comment:
Dear Friends,
Do we have any method to copy a file in VB 6.0 as we have the Kill command to delete a file.

Pls Help

Thanx

Joshua


Report Offensive Message For Removal


Response Number 1
Name: HiJinx
Date: February 15, 2005 at 23:21:31 Pacific
Subject: VB Copy Command
Reply: (edit)
FileCopy source, destination

You also have to include the filename in 'destination', not just the destination folder.

ie:

FileCopy "c:\test.txt", "c:\junk\test.txt"


Report Offensive Follow Up For Removal

Response Number 2
Name: Kamran
Date: March 5, 2005 at 13:08:19 Pacific
Subject: VB Copy Command
Reply: (edit)
Add the following objects to a new project:

Name Value Description

FO_COPY &H2 Copies a file or folder
FO_DELETE &H3 Deletes a file or folder
FO_MOVE &H1 Moves a file or folder
FO_RENAME &H4 Renames a file or folder
FOF_ALLOWUNDO &H40 Used with Rename. When used with Delete the files get sent to the Recycle Bin.
FOF_FILESONLY &H80 Only allows files.
FOF_NOCONFIRMATION &H10 Does not display the Delete or Overwrite confirmation dialog.
FOF_SILENT &H4 Does not display the Windows animation while performing the opperation.
FOF_SIMPLEPROGRESS &H100 Does not display filenames


Add the following to a new module


Public Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As Long ' only used if FOF_SIMPLEPROGRESS, sets dialog title
End Type

Public Const FO_COPY = &H2 ' Copy File/Folder
Public Const FO_DELETE = &H3 ' Delete File/Folder
Public Const FO_MOVE = &H1 ' Move File/Folder
Public Const FO_RENAME = &H4 ' Rename File/Folder
Public Const FOF_ALLOWUNDO = &H40 ' Allow to undo rename, delete ie sends to recycle bin
Public Const FOF_FILESONLY = &H80 ' Only allow files
Public Const FOF_NOCONFIRMATION = &H10 ' No File Delete or Overwrite Confirmation Dialog
Public Const FOF_SILENT = &H4 ' No copy/move dialog
Public Const FOF_SIMPLEPROGRESS = &H100 ' Does not display file names

Public Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" _
(lpFileOp As SHFILEOPSTRUCT) As Long


____________________________________________
This will copy c:\backup to c:\backup2 and will not show filenames:


Dim op As SHFILEOPSTRUCT
With op
.wFunc = FO_COPY ' Set function
.pTo = "C:\backup2" ' Set new path
.pFrom = "C:\backup" ' Set current path
.fFlags = FOF_SIMPLEPROGRESS
End With
' Perform operation
SHFileOperation op



Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: VB Copy Command

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




DSHUB24 Connection Problems

need help with dsl and dial up

novel 3.12

help mandriva install last straw!

Icon Scaling in Explorer Bar


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC