+ Post New Thread
Results 1 to 6 of 6
Windows Thread, Script to copy folder in Technical; To save me reinventing the wheel does anyone have a script that will copy a folder from a network share ...
  1. #1
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,196
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74

    Script to copy folder

    To save me reinventing the wheel does anyone have a script that will copy a folder from a network share to local that will run at station startup?

    I'd like to copy a default user folder from the server to the overwrite the local default user profile on clients at startup.

    Cheers.

  2. #2
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    791
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    Code:
    xcopy "\\server\share\Default User" "c:\Documents and Setings\Default User" /y
    This should copy the contents of the folder. Create a bat file and run at startup...
    Although a robocopy script may reduce the startup time, as it can skip files that haven't been changed.

  3. #3
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,196
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    Hmmm I was trying to create a VBScript I hadn't thought about a Robocopy, can Robocopy be run from a share as well so it doesn't have to be on every station?

  4. #4
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    791
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    I like to keep things simple (just like me, I here everyone say), but to answer your question yes robocopy will run from a share.

  5. Thanks to IrritableTech from:

    cookie_monster (6th October 2009)

  6. #5
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,196
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    It runs from a share and you can use variables excellent

    Code:
    %logonserver%\NETLOGON\robocopy\robocopy "%logonserver%\NETLOGON\Default User" "C:\Documents and Settings\Default User" /E /PURGE /V /NP /R:10 /W:30

  7. #6
    cookie_monster's Avatar
    Join Date
    May 2007
    Location
    Derbyshire
    Posts
    4,196
    Thank Post
    392
    Thanked 278 Times in 239 Posts
    Rep Power
    74
    Ok that almost works flawlessly except that it won't run as a startup script and the logfile is blank. It does work if I specify 'servername' rather than %logonserver% but i'd rather distribute the load.

    Any ideas?

    EDIT

    Sorted it \\domainname.whatever\netlogon works and it puts a nice little log on C:\

    Code:
    \\domain.com.uk\NETLOGON\robocopy\robocopy "\\domain.com.uk\NETLOGON\Default User" "C:\Documents and Settings\Default User" /E /PURGE /V /NP /R:10 /W:30 >C:\robolog.txt
    Last edited by cookie_monster; 7th October 2009 at 11:43 AM.

SHARE:
+ Post New Thread

Similar Threads

  1. vbscript to copy a folder & delete a folder
    By MicrodigitUK in forum Scripts
    Replies: 2
    Last Post: 29th January 2009, 12:43 PM
  2. need a script to copy a folder with shortcuts
    By jamin100 in forum Scripts
    Replies: 1
    Last Post: 4th September 2008, 07:38 PM
  3. VBS Script to copy a folder
    By FN-GM in forum Scripts
    Replies: 2
    Last Post: 23rd February 2008, 01:08 PM
  4. Replies: 21
    Last Post: 29th December 2007, 10:53 PM
  5. VB Script ti check for folder and then copy contents to PC
    By tosca925 in forum How do you do....it?
    Replies: 4
    Last Post: 2nd October 2006, 08:15 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •