script to copy an entire folder?

Discussion in 'Scripting' started by Fred Bloggs, Feb 12, 2010.

  1. Fred Bloggs

    Fred Bloggs Guest

    I'm looking to get a folder including it's contents moved from a shared
    server folder to the users c drive, during their login. I have a script to
    move a file, but is it possible to copy a folder / directory too?

    Fred Bloggs, Feb 12, 2010
    1. Advertisements

  2. Does it have to be a script? The "CopyFolder" wheel has already been
    invented with the xcopy.exe or robocopy.exe command
    Pegasus [MVP], Feb 12, 2010
    1. Advertisements

  3. Fred Bloggs

    Al Dunbar Guest

    If you are using vbscript, I believe that the file system object supports a
    copyfolder method in addition to copyfile.

    If you are using batch, the xcopy command has a switch that does that: /s

    Al Dunbar, Feb 13, 2010
  4. Fred Bloggs

    Fred Bloggs Guest

    Hi all,
    Many thanks for that, what I'm trying to do is this.

    in the past a support firm have set a group policy to store corporate
    templates for office programs on the network drive.
    Every now and then we get problems with the templates and users are getting
    an error message each time they shut word, excel, outlook etc. The message
    refers to the normal template. So I have rejigged the policy to look at a
    local folder on each laptop.
    As a 1 off I'm looking to modify the login script so the contents of the
    network templates folder can be copied to each users laptop, to the new
    location given in group policy.

    I'm concerned that if i send out a script, that either the anti virus on
    each pc will block the script, or users will ignore the message until it's
    too late as such.

    I hope that explains things further....

    Thanks for your assistance so far.
    Fred Bloggs, Feb 16, 2010
  5. AFAIK, anti-virus software will not block a batch file. It might block a
    specific command invoked by the batch file but this is very unlikely to
    happen with a native Windows tool such as robocopy.exe or xcopy.exe.
    Pegasus [MVP], Feb 16, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.