Page 1 of 1 1
Topic Options
#23254 - 2002-06-14 10:17 PM File copy (want to copy f.e. DOC files on from local to network drive)
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
Is there any way to do a file copy with kixtart that searches out and copies a spcified file from all the subfolders of the one i specify??

ex.
i want to copy all *.doc files on the c: drive to an h: drive (network)

if i use;
copy c:\*.doc h:\DOCBACKUP

it only searches c:, and nothing below it.

(MCA: complete subject)

[ 17 June 2002, 08:57: Message edited by: MCA ]

Top
#23255 - 2002-06-14 10:26 PM Re: File copy (want to copy f.e. DOC files on from local to network drive)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Grab the and of the DIR*() UDFs in the UDF section. Then enumerate the requested list of files and copy them to the destination. Be aware, that what you are trying to do will take a long time if there are a lot of directories because everysingle directory must be scanned.

It might be easier to require all documents to be saved in a specific location. Then you just need to copy the parent folder of that location.
_________________________
There are two types of vessels, submarines and targets.

Top
#23256 - 2002-06-14 10:28 PM Re: File copy (want to copy f.e. DOC files on from local to network drive)
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
I think i might have to use a utility like robocopy or something maybe.
Top
#23257 - 2002-06-14 10:28 PM Re: File copy (want to copy f.e. DOC files on from local to network drive)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
this is a bat file... but you can convert it if you need to.

[@echo off

if exist "c:\program files\ase\data\aspen.mdb" md "h:\aspen" & move "c:\program files\ase\data\*.mdb" "h:\aspen"
if exist "c:\cognos\BI96\workspce\*.imt" md "h:\improm35" & move "c:\cognos\BI96\workspce\*.imt" "h:\improm35"
if exist "c:\My Documents" md "h:\My Documents" & move "c:\My Documents\*.*" "h:\My Documents"
if exist "%userprofile%\favorites\*.*" md h:\Favorites & move "%userprofile%\favorites\*.*" h:\Favorites
if exist "%userprofile%\desktop\*.*" md h:\Desktop & move "%userprofile%\desktop\*.*" h:\Desktop
if exist "%userprofile%\Personal\*.*" md h:\Personal & move "%userprofile%\Personal\*.*" h:\Personal
if exist "%userprofile%\Application Data\Microsoft\Templates\Normal.dot" md h:\Normal & move "%userprofile%\Application Data\Microsoft\Templates\Normal.dot" h:\Normal

md h:\Word
md h:\Excel
md h:\PowerPoint
md h:\Outlook
md h:\Publisher
md h:\Access
for /r c:\ %%a in (*.doc) do xcopy "%%a" h:\Word /s /i
for /r c:\ %%a in (*.xls) do xcopy "%%a" h:\Excel /s /i
for /r c:\ %%a in (*.ppt) do xcopy "%%a" h:\PowerPoint /s /i
for /r c:\ %%a in (*.pub) do xcopy "%%a" h:\Publisher /s /i
for /r c:\ %%a in (*.mdb) do xcopy "%%a" h:\Access /s /i
for /r c:\ %%a in (*.pst *.pab) do xcopy "%%a" h:\Outlook /s /i

net use | find /i ":" > H:\%username%-Drives.txt
\\a06\logon\reg query hkcu\printers\connections > H:\%username%-Printers.txt
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#23258 - 2002-06-14 10:32 PM Re: File copy (want to copy f.e. DOC files on from local to network drive)
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
thanks...i may reconsider the robocopy
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.165 seconds in which 0.144 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org