1. Attachments are working again! Check out this thread for more details and to report any other bugs.

IT Question

Discussion in 'Fred's House of Pancakes' started by Renocat, Apr 17, 2007.

  1. Renocat

    Renocat Member

    Joined:
    Jul 13, 2006
    363
    11
    0
    Location:
    Rochester, NY
    Vehicle:
    2015 Prius
    Model:
    Three
    Hi All,
    I am looking for a way to copy one file to many locations. I did find a utility but don't want to spend $50 for something I will use once or twice a year.

    Here are my specifics:
    Source and destination are on a Novell server
    Need to copy the source into all the folders contained within a directory.

    In other words...I have ~100 student directories within the 2014 directory. Each student needs a copy of myfile.doc

    Any suggestions?

    Thanks
    Kim
     
  2. Stev0

    Stev0 Honorary Hong Kong Cavalier

    Joined:
    Sep 23, 2006
    7,201
    1,073
    0
    Location:
    Northampton, MA
    Vehicle:
    2022 Prius Prime
    Model:
    Plug-in Base
    I'm sure there's an easier way, but here's the old-school way:

    Assume myfile.doc is in the directory you're making the student directories off of.

    Make this batchfile. Call it anything you want, but for this example I'll call it FOO.BAT

    Assuming each student has the directory as first initial, last name, for example when making Suzanne Smith's directory, enter the command

    FOO SSMITH

    It will then create said directory and copy said file into it. It will work no matter what format you create the directories with as long as it's one string. (ie, FOO SUZANNES, or even FOO SUZANNE.SMITH).

    Of course, if you've already created the directories, you're out of luck.
     
  3. priusenvy

    priusenvy Senior Member

    Joined:
    Mar 15, 2004
    1,765
    14
    0
    Location:
    Silicon Valley, CA
    Vehicle:
    2005 Prius
    UNIX shell (sh, ksh, or bash):

    $ for i in /path/to/2014/*; do
    > cp /path/to/myfile.doc $i
    > done
    $
     
  4. jiepsie

    jiepsie New Member

    Joined:
    Jun 18, 2006
    267
    3
    0
    There are many other ways to do this from a Windows computer. If all the directories already exist, it's possbile to have a batch file find each of them and put the file there. It's also possible to have a list of student names and/or corresponding directory names in a text file. A batch file can process this text file and do whatever you want for each line in there.

    The trick to all this is the FOR command.
    MS documentation on using "FOR"
     
  5. Wildkow

    Wildkow New Member

    Joined:
    Jan 24, 2006
    5,270
    37
    36
    Vehicle:
    2006 Prius
    <div class='quotetop'>QUOTE(Renocat @ Apr 17 2007, 06:09 PM) [snapback]424993[/snapback]</div>
    Renocat try this, it's less than 20 and has a trial version. . . Also why can't you e-mail the little darlings the file, MS Outlook can do groups and you can ask for a receive and read receipt for confirmation.

    http://www.sobolsoft.com/copyfiles/
     
  6. Renocat

    Renocat Member

    Joined:
    Jul 13, 2006
    363
    11
    0
    Location:
    Rochester, NY
    Vehicle:
    2015 Prius
    Model:
    Three
    <div class='quotetop'>QUOTE(Wildkow @ Apr 18 2007, 07:20 AM) [snapback]425210[/snapback]</div>
    Thanks guys for all the responses.

    I have tried this software, Wildkow, and it locks up. I think it cannot handle the volume of folders I need to copy into.

    We don't give the little darlings e mail accounts because, well, they are little darlings :p do I can't e mail the file to them.

    I think I will give the bat file a shot and see how that goes.
     
  7. tnthub

    tnthub Member

    Joined:
    Jun 12, 2006
    519
    8
    0
    Location:
    Brunswick, Maine
    Vehicle:
    2007 Prius
    Model:
    N/A
    Have the administrator establish a directory on the server for you to place the one file. Have the administrator make a global logon command for each student to access the directory and script a download to their desktop. Usually if there is a distribution requirement on a managed network the administrator will take care of it in the same way patches and updates are applied and pushed down to the desktop level.
     
  8. Renocat

    Renocat Member

    Joined:
    Jul 13, 2006
    363
    11
    0
    Location:
    Rochester, NY
    Vehicle:
    2015 Prius
    Model:
    Three
    <div class='quotetop'>QUOTE(tnthub @ Apr 18 2007, 09:16 AM) [snapback]425245[/snapback]</div>
    I am the administrator :p That approach would work but I didn't want to spend the time setting it up. This was a last minute project a teacher needed.

    I used a variation of the bat file that Stev0 posted. Took about 4 seconds to copy into all folders.
     
  9. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    <div class='quotetop'>QUOTE(Stev0 @ Apr 17 2007, 10:17 PM) [snapback]425054[/snapback]</div>
    Yeah, if the directories are already created, that won't work. what you'll have to do is:

    foo.bat:
    put foo in the main directory that contains all of your students directories. run it, and it'll first create the temp.txt file, which will simply be a listing of all the directories in that folder (ie all of the student's directories). Then the for loop will loop over that file and copy the test.txt file into all of the folders listed in it.

    The shell script will work perfectly if you have access to a unix shell to do it on.
     
  10. airportkid

    airportkid Will Fly For Food

    Joined:
    Sep 2, 2005
    2,191
    538
    0
    Location:
    San Francisco Bay Area CA
    Vehicle:
    2005 Prius
    Wow, what a hole in O/S's that they can't handle this with a normal copy command! Wildcards work for the origin; why do the O/Ss fail to accept them for the destination? This syntax fails in DOS mode:

    Copy MYFILE.TXT TOPDIR\*\MYFILE.TXT

    ... but there's no good reason why it should!

    I seem to recall being able to do this in VMS on DEC mainframes back in the early 80s with syntax as above. Not that it helps here.

    Well, good luck with whatever kludge it takes to do the deed! And I'm sorry I can't offer anything better than what's alreadly been suggested.

    Mark Baird
    Alameda CA
     
  11. Wildkow

    Wildkow New Member

    Joined:
    Jan 24, 2006
    5,270
    37
    36
    Vehicle:
    2006 Prius
    <div class='quotetop'>QUOTE(Renocat @ Apr 18 2007, 07:11 AM) [snapback]425268[/snapback]</div>
    StevO is "Da Man" today! :lol: Now git back to Folding becuase your slacking!

    Wildkow

    p.s. BTW isn't Novell owned by a Linux OS Company and doesn't it have a very similar command line structure to Linux/Unix??
     
  12. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    I agree airportkid... it's a rather large hole that really shouldn't be there... every time you're putting in a file path, it *should* go to the same parser, which then by default would recognize the wildcards. There's really no reason no to do it that way... but then again, there's a reason it's called DOS!
     
  13. Renocat

    Renocat Member

    Joined:
    Jul 13, 2006
    363
    11
    0
    Location:
    Rochester, NY
    Vehicle:
    2015 Prius
    Model:
    Three
    <div class='quotetop'>QUOTE(Wildkow @ Apr 18 2007, 01:06 PM) [snapback]425390[/snapback]</div>
    Yes Novell is owned by a Linux OS company but I don't have a Unix box at school.

    This is the code that finally worked for me. I put this bat file and my source file in the directory that held the student folders and ran it.