Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS to Copy a single file ??

Status
Not open for further replies.

GregNVMC

IS-IT--Management
Jul 8, 2003
19
GB
Hello,

Please can someone help me.

I want to write a vb script to copy a single file from a dir to another dir, but prompt the user to specify a new name for the file during the copy.

The file being copied will always be in the same location on the C:\ drive, and the destination will always be the same H:\Audit. I know how to use a message box to store the new filename, but I don't know how to use vbs to copy files?

Any help is greatly appreciated :)

Kind Regards,

Greg
 
Take a look at the CopyFile method of the FileSystemObject.

Hope This Help
PH.
 
something like
set fso = createobject("scripting.filesystemobject")
set ofile = fso.getfile("path\filename")'
ofile.copy("path\")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top