I use this command

xcopy c:\source m:\dest\local /m/e/e/v/h/y

which works quite well.
Now I need to copy only files below 1 MByte
because files greater than 1 MByte are rare but can fill the destination too
quickly.
(Sorry for my English)
I think, the answer will be in VBS.

Thanks for all

Bernd

Re: Copy files up to 1Mbyte by Bernd

Bernd
Mon Jul 10 07:40:31 CDT 2006

Sorry, the correct line to replace is

xcopy c:\source m:\dest\local /m/k/r/s/e/v/h/y

> I use this command
>
> xcopy c:\source m:\dest\local /m/e/e/v/h/y
>
> which works quite well.
> Now I need to copy only files below 1 MByte
> because files greater than 1 MByte are rare but can fill the destination
too
> quickly.
> (Sorry for my English)
> I think, the answer will be in VBS.
>
> Thanks for all
>
> Bernd
>
>



Re: Copy files up to 1Mbyte by Michael

Michael
Mon Jul 10 09:31:42 CDT 2006

On Mon, 10 Jul 2006 12:21:38 +0200, "Bernd Blaue" wrote in
microsoft.public.scripting.vbscript:

>I use this command
>
>xcopy c:\source m:\dest\local /m/e/e/v/h/y
>
>which works quite well.
>Now I need to copy only files below 1 MByte
>because files greater than 1 MByte are rare but can fill the destination too
>quickly.
>(Sorry for my English)
>I think, the answer will be in VBS.

Or using a decent CLI (4NT):
COPY /[s0,1M] /M /K /Z /S /H c:\source m:\dest\local

4NT is a commercial product. COPY is documented at
<http://jpsoft.com/help/copy.htm> Size Ranges at
<http://jpsoft.com/help/sizeranges.htm>.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

Re: Copy files up to 1Mbyte by Bernd

Bernd
Mon Jul 10 10:27:41 CDT 2006


Thank you for your short answer. If there is nobody who helps me with a free
product or with self-written code I try to use your hint. I think it will
work (if I replace your proposed /M by /X).

Bernd

>
> Or using a decent CLI (4NT):
> COPY /[s0,1M] /M /K /Z /S /H c:\source m:\dest\local
>
> 4NT is a commercial product. COPY is documented at
> <http://jpsoft.com/help/copy.htm> Size Ranges at
> <http://jpsoft.com/help/sizeranges.htm>.
>
> --
> Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



Re: Copy files up to 1Mbyte by Jennifer

Jennifer
Mon Jul 10 16:51:27 CDT 2006

This is free and should do the trick. The only thing is, Fil.Size will
be in Kilobytes and I have no idea what the conversion is from
Megabytes off the top of my head. I'm sure you can google it.


Dim fso
Dim fol
Dim Fil
Dim sSourceFolderName
Dim sDestFolderName

sSourceFolderName = "C:\Source"
sDestFolderName = "m:\dest\local"

Set fso = CreateObject("scripting.filesystemobject")
Set fol = fso.GetFolder(sFolderName)

For Each Fil In fol.Files
If Fil.Size < ??
fso.CopyFile(sSourceFolderName, sDestFolderName)
End If
Next

Bernd Blaue wrote:
> Thank you for your short answer. If there is nobody who helps me with a free
> product or with self-written code I try to use your hint. I think it will
> work (if I replace your proposed /M by /X).
>
> Bernd
>
> >
> > Or using a decent CLI (4NT):
> > COPY /[s0,1M] /M /K /Z /S /H c:\source m:\dest\local
> >
> > 4NT is a commercial product. COPY is documented at
> > <http://jpsoft.com/help/copy.htm> Size Ranges at
> > <http://jpsoft.com/help/sizeranges.htm>.
> >
> > --
> > Michael Bednarek http://mbednarek.com/ "POST NO BILLS"


Re: Copy files up to 1Mbyte by Jennifer

Jennifer
Mon Jul 10 16:57:24 CDT 2006

Sorry...made a mistake. The SIZE property is in BYTES, not kilobytes.


Jennifer wrote:
> This is free and should do the trick. The only thing is, Fil.Size will
> be in Kilobytes and I have no idea what the conversion is from
> Megabytes off the top of my head. I'm sure you can google it.
>
>
> Dim fso
> Dim fol
> Dim Fil
> Dim sSourceFolderName
> Dim sDestFolderName
>
> sSourceFolderName = "C:\Source"
> sDestFolderName = "m:\dest\local"
>
> Set fso = CreateObject("scripting.filesystemobject")
> Set fol = fso.GetFolder(sFolderName)
>
> For Each Fil In fol.Files
> If Fil.Size < ??
> fso.CopyFile(sSourceFolderName, sDestFolderName)
> End If
> Next
>
> Bernd Blaue wrote:
> > Thank you for your short answer. If there is nobody who helps me with a free
> > product or with self-written code I try to use your hint. I think it will
> > work (if I replace your proposed /M by /X).
> >
> > Bernd
> >
> > >
> > > Or using a decent CLI (4NT):
> > > COPY /[s0,1M] /M /K /Z /S /H c:\source m:\dest\local
> > >
> > > 4NT is a commercial product. COPY is documented at
> > > <http://jpsoft.com/help/copy.htm> Size Ranges at
> > > <http://jpsoft.com/help/sizeranges.htm>.
> > >
> > > --
> > > Michael Bednarek http://mbednarek.com/ "POST NO BILLS"


Re: Copy files up to 1Mbyte by Don

Don
Tue Jul 11 12:38:43 CDT 2006

On Mon, 10 Jul 2006 12:21:38 +0200, in
microsoft.public.scripting.vbscript "Bernd Blaue"
<gruene@hannoversche-kassen.de> wrote:

|I use this command
|
|xcopy c:\source m:\dest\local /m/e/e/v/h/y
|
|which works quite well.
|Now I need to copy only files below 1 MByte
|because files greater than 1 MByte are rare but can fill the destination too
|quickly.
|(Sorry for my English)
|I think, the answer will be in VBS.
|
|Thanks for all
|
|Bernd
|
You might consider using xxcopy. It is a free program (if you're not
doing commercial work with it!) and it does have keys for doing what
you want. Google xxcopy and get the program. Hope this helps.

Re: Copy files up to 1Mbyte by Dr

Dr
Tue Jul 11 11:17:01 CDT 2006

JRS: In article <OuvxlqApGHA.4812@TK2MSFTNGP04.phx.gbl>, dated Mon, 10
Jul 2006 12:21:38 remote, seen in news:microsoft.public.scripting.vbscri
pt, Bernd Blaue <gruene@hannoversche-kassen.de> posted :
>I use this command
>
>xcopy c:\source m:\dest\local /m/e/e/v/h/y
>
>which works quite well.
>Now I need to copy only files below 1 MByte
>because files greater than 1 MByte are rare but can fill the destination too
>quickly.
>(Sorry for my English)
>I think, the answer will be in VBS.


HUNT c:\source\*.* "copy" "m:\dest\local\*.*" z-999999 u
omit u for test or z-1048575

should do what your words ask for; and with additional parameters it
should do at least some of what your XCOPY options ask for. It can
check, but not alter, the attribute bits; but you could get it to call a
batch helper which would copy one file and change the bit; or you could
make HUNT call XCOPY with the option for that ...

Get HUNT via sig line 3.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

Re: Copy files up to 1Mbyte by Bernd

Bernd
Thu Jul 13 01:43:00 CDT 2006

Thank you for your code. But the FOR EACH...NEXT doesn't work.
The command-line fso.CopyFile... copies all files in one call!
In which way I can copy the files in the folders and subfolders recursively
but one by one, so I can read (and manipulate) the attributes of each file
like size, archive-bit, read-only?
Here my code instead of your FOR EACH ... NEXT-lines (VBS):
------------------------------------------------------------
Set fol = fso.GetFolder(sSourceFolderName)

'First I copy recursively all folders and subfolders to get the
folderstructure
fso.CopyFolder sSourceFolderName & "\*", sDestFolderName & "\"

'Then I copy recursively all files by one command-line (This should be
replaced!!!)
fso.CopyFile fol + "\*.*", sDestFolderName
------------------------------------------------------------
Best wishes
Bernd
-----------------------------------------------------------
-----------------------------------------------------------
>"Jennifer" <J.Evans.1970@gmail.com> >
>
> Dim fso
> Dim fol
> Dim Fil
> Dim sSourceFolderName
> Dim sDestFolderName
>
> sSourceFolderName = "C:\Source"
> sDestFolderName = "m:\dest\local"
>
> Set fso = CreateObject("scripting.filesystemobject")
> Set fol = fso.GetFolder(sFolderName)
>
> For Each Fil In fol.Files
> If Fil.Size < ??
> fso.CopyFile(sSourceFolderName, sDestFolderName)
> End If
> Next
>



Re: Copy files up to 1Mbyte by Michael

Michael
Thu Jul 13 04:46:27 CDT 2006

On Thu, 13 Jul 2006 08:43:00 +0200, "Bernd Blaue" wrote in
microsoft.public.scripting.vbscript:

>Thank you for your code. But the FOR EACH...NEXT doesn't work.
>The command-line fso.CopyFile... copies all files in one call!
[snip]

Of course it does:
fso.CopyFile(sSourceFolderName, sDestFolderName)
^^^^^^^^^^^^^^^^^
Try instead:
fso.CopyFile Fil.Name, sDestFolderName

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"