Re: copy bat



What I would do is use the FileSystemObject for the whole thing. This would
require no additional software.

Paul

"Paul Randall" <paulr901@xxxxxxxxxxxx> wrote in message
news:uPT%23yvuJIHA.3848@xxxxxxxxxxxxxxxxxxxxxxx
Perhaps you can do the whole thing with VBScript. Look at:
http://web.archive.org/web/20070520094916/www.microsoft.com/technet/community/columns/scripts/sg0105.mspx
under the section titled:
Retrieving a Collection of Files

I think you can easily modify the script in that section to get the list
of the files in which you are interested, into a disconnected recordset.
Then you could loop through the record set and use the File System Object
to copy or move each file.

I have not used logparser from the command line or the scriptable
MSUtil.LogQuery object, but the link I referenced above should provide
most of the information you need.

-Paul Randall

"luca" <luca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA940C74-DB9D-41DC-8E18-E5F616AE8439@xxxxxxxxxxxxxxxx
Ok thank's for your help.
I have download xxcopy. Then I put in c:\andrea (source) 3 files created
in
2006 year. Then I have runa script, but in the d:\Backup folder I have
not
looked the 3 files created in 2006 and these file have more that 7
days...or
not?

Thank's
Luca

"Pegasus (MVP)" wrote:

I don't know what "logparser" is. If this was my machine then
I would use a script like this one:

@echo off
set Age=7
set Source=c:\Andrea
set Target=d:\Backup\
xxcopy /db#%Age% /s /d /c /y "%Source%" "%Target%"

You can download xxcopy.exe from a number of sites.


"luca" <luca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A60431DF-4384-4B2D-920D-1304FE584587@xxxxxxxxxxxxxxxx
Ok . I try, sorry for my english...
I must copy file more old of 7 days . For this I use logparser with
this
scipt:

logparser "select path from c:\test\*.* where

iv(sub(to_int(system_date()),to_int(to_date(creationtime))),86400)>7"
-i:FS
-q:on


The result og logparser must be copied in another folder. Iwould use
this

for /F %i in ('logparser "select path from c:\andrea\*.* where

iv(sub(to_int(system_date()),to_int(to_date(creationtime))),86400)>7"
-i:FS
-q:on'

But when I save this script as .bat or .cmd I have an error when I
lunch.
So I think if I write this one:

for /F %i in ('logparser "select path from c:\andrea\*.* where

iv(sub(to_int(system_date()),to_int(to_date(creationtime))),86400)>7"
-i:FS
-q:on'>>test.bat

The result of logparser go in the .bat file. But then how make the
copy
from
test.bat file?

Thank's a lot

Luca



"Pegasus (MVP)" wrote:


"luca" <luca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1475B744-12BE-4171-8C48-62D878F27DD8@xxxxxxxxxxxxxxxx
Sorry,
one questions.
I would copy a file that are in the bat file. For example if I open
my
bat
file I look this:

C:\test1
C:\test\test2

etc.

I Would copy this file (by batch or script) in another destination.
Is
it
possible?

Thank's
luca

It's probably possible but I am unable to understand your
question. Please rephrase it.










.



Relevant Pages

  • Re: Running Login Script after establishing a VPN connection
    ... I dont know what you mean by a "pure batch command". ... "Pegasus (MVP)" wrote: ... This would be equivalent to your current VB Script program ... The network drive disconnects before the bat file ...
    (microsoft.public.windows.server.scripting)
  • Re: copy bat
    ... I have download xxcopy. ... I would use a script like this one: ... The result og logparser must be copied in another folder. ... I would copy a file that are in the bat file. ...
    (microsoft.public.scripting.wsh)
  • Re: copy bat
    ... I agree - looks like a very useful command, but as you say, ... I would use a script like this one: ... For this I use logparser with this ... The result of logparser go in the .bat file. ...
    (microsoft.public.scripting.wsh)
  • Re: copy bat
    ... "Paul Randall" wrote: ... I have not used logparser from the command line or the scriptable ... Then I have runa script, but in the d:\Backup folder I have not ... I would copy a file that are in the bat file. ...
    (microsoft.public.scripting.wsh)
  • Re: copy bat
    ... I have not used logparser from the command line or the scriptable ... Then I have runa script, but in the d:\Backup folder I have not ... "Pegasus (MVP)" wrote: ... I would copy a file that are in the bat file. ...
    (microsoft.public.scripting.wsh)