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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying files copied 3

Status
Not open for further replies.

omegabeta

Programmer
Aug 20, 2003
148
RO

How can I display in a window each file that are copied, like with COPY command launched from a .bat file ?

Thanks
 
Hello omegabeta,

One demonstration is this.
Code:
source="d:\test\abc\"
destination="d:\test\def\"
set fso=createobject("scripting.filesystemobject")
set oFolder=fso.GetFolder(source)
msg="" : count=0
for each oFile in oFolder.Files
    oFile.copy destination, true
    msg=oFile.path & vbcrlf
    count=count+1
next
msg=msg & "        " & cstr(count) & "file(s) copied"
set oFolder=nothing
set fso=nothing
wscript.echo msg    'or do whatever you want with msg
regards - tsuji
 
corection:

Did not get the msg formatting right. Here is the correction.
Code:
msg=[COLOR=green]msg[/color] & oFile.path & vbcrlf
'also this line
msg=msg & "        " & cstr(count) & " file(s) copied"
- tsuji
 
Try something like this:
srcdir="\path\to\srcdir"
destdir="\path\to\destdir"
Set SA=CreateObject("Shell.Application")
Set NS=SA.NameSpace(destdir)
NS.CopyHere srcdir,16

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks to both. I cannot give a star because the link is not working properly...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top