1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

copy a bunch of files on a home windows server where first 6 characters equal the folder into the fo

Discussion in 'Site & Server Administration' started by xbat, May 24, 2016.

  1. #1
    I have a simple windows computer windows 7 pro. Its our little cheap server. I have a bunch of file names that are for example file1,file2,file2a,file2b,file3 etc... Then I have a bunch of folders. file1, file2, file3, file4 etc..

    What I want to do is copy every file into the same folder name. but only do the first so many characters that way everything with file2 will go into the folder file2.

    Is there any way to do this with command prompt or is there some program out there?

    thanks
     
    xbat, May 24, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Well, the simple way would be to sort by filename in explorer and just mark every filename that goes into one folder and copy/nove them. Or, via cmd do copy file1*.* file1 (I'm sure it's possible to do everything at once with some regex, but I'm not really that good with such things on Windows) - it is however, not really that hard to do somewhat manually if you haven't got thousands of files.
     
    PoPSiCLe, May 26, 2016 IP
    sarahk likes this.
  3. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #3
    yes :) i agree with php kind of kicking myself right now for not doing it in a php section of the server. Believe it or not you gave me a tip a while back on php how to do something like that.... But windows... aghh I would install php but the people are picky.. thats why im left cmd, or some other small option I guess. At least the priority is low.
     
    xbat, May 27, 2016 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Well, technically, if the files and folders are available to a webserver, it could be done via php, but that seems like perhaps a bit of overkill unless you already are running php on the server
     
    PoPSiCLe, May 29, 2016 IP