Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Lounger
    Join Date
    Aug 2014
    Posts
    31
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Automatic file copying

    Hi all,

    Bit of a complex one here, but hopefully, someone can offer either "it's impossible", or "here's how to do it".

    My organisation is quite strict on some softwares, so I need to be able to do this without 3rd party software if possible.

    We have a range of documents that are stored in dated folders, named '01-01-15', 01-02-15' (DD-MM-YY), etc. If an old document is updated, the new version is saved in the newer folder.

    This is fine, but what I would like to do, is every document that is Saved could be copied into another folder based on a keyword.

    An example, a document called 'Menu Selections' could be open from '01-01-15', amended, then saved into '01-05-15', but because it has the word 'Menu' in the title, the update copy would be auto-copied to the 'MENU' folder, and so forth.

    I'm trying to explain something like Outlook rules - if an email comes from Mr A about the menus, I can easily set a rule to copy the email to the menu's folder. Same principle.

    Any ideas guys? Rules? Macros? VB?

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    leeroy,

    Of course it is Possible, everything is if you're clever enough!

    This could be done with a combination of PowerShell (built in to newer versions of windows) and the task scheduler. Of course some orgs don't allow the use of PowerShell scripts.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. The Following User Says Thank You to RetiredGeek For This Useful Post:

    leeroysilk (2015-05-20)

  4. #3
    Lounger
    Join Date
    Aug 2014
    Posts
    31
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Hi RetiredGeek, thanks for getting back to me. Through using this site over the last few months, I get the impression a majority of users are from USA, and with the time difference, I wasn't expecting a reply until tomorrow, so thank you.

    Is there a way I can find out if I A) have Powershell and Task Scheduler, and B) find out if I am blocked? I don't mind if the helpdesk shout at me, I'll just tell them I was trying something, but I know for a full fact they wouldn't allow a 3rd party download.

  5. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    leeroy,

    You don't say what version of Windows you have but assuming Win 7 or higher.

    Click the Orb.
    Type: PowerShell
    PowershellPgms.JPG

    The Task Scheduler is built into every version of Windows.
    Click the Orb.
    Type: Schedule
    Task Scheduler will show up at the top of the search window.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  6. #5
    Lounger
    Join Date
    Aug 2014
    Posts
    31
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Hi,

    Yes, sorry, Win7.

    I found Powershell, clicked it, now I'm faced with a blue window that says PS C:\Users\[username]>

    Does this mean it will work without admin restrictions?

    Also, what would my next steps be? I apologise if you don't have the time to answer, its just you're the only person who has responded so far.

  7. #6
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,729
    Thanks
    95
    Thanked 128 Times in 125 Posts
    If I understand the OP situation correctly, possibly, some creative Batchfiling will do most if not all of the automatic-copying. I've never done date-flagging & copying, so I'm unsure how that would be accomplished. Key-word search and copy -- I don't know if or how batchfiling can do that.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  8. #7
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    leeroy,

    See this thread post #2 Items 1-3 to get PowerShell to where it will actually work!

    Now comes the hard part. You'll need a script (program) to do what you want. If you can succinctly write out the requirements (specifications) I'll give it a go.

    Here's a sample program that copies files based on file content:
    Code:
    <# +-----------------------------------------------------+
       | Program Name: Copy Files Based on File Contents.ps1 |
       | Programmed by: ComputerMentor                       |
       |           AKA: Bruce E. Kriebel                     |
       | Created      : 07/08/14                             |
       | Last Update  :                                      |
       | Version No.  : 1.0                                  |
       +-----------------------------------------------------+
    #>
    
    $SourceDrivePath = "G:\BEKDocs\Excel\Finances\Net Worth Files"  #Replace w/your drive\dir
    $DestDrivePath = "G:\Test"   #Replace with your drive\dir
    $FileTypeToCopy = "xls"
    $MatchString = "Expedition"
    
    $FileCnt = 0
    
    Get-ChildItem "$SourceDrivePath\*.$FileTypeToCopy"  | `
      Foreach-Object {
          $Test = Select-String -Path $_.FullName -Pattern $MatchString
    
          if ($Test.Filename.Length -gt 0) {
            Write-Host $Test.Filename
            $FileCnt += 1
            $NewFN = $_.BaseName.$FileTypeToCopy
            Copy-Item  $_.FullName "$DestDrivePath\$NewFN"
          }
    
      }
    
      Write-Host "$FileCnt Files Processed"
    Shouldn't take too awful much to modify it to work on file names/dates although your specifications will dictate how complicated it is.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. The Following User Says Thank You to RetiredGeek For This Useful Post:

    leeroysilk (2015-05-21)

  10. #8
    Lounger
    Join Date
    Aug 2014
    Posts
    31
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Thanks RolandJS, and RetiredGeek, you're a legend! I'm a tad busy for most of the morning, but can I get something to you this afternoon (uk time here). its almost 9am, so I'll try to get something in the next 3-4 hours. Meetings :-(

  11. #9
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,729
    Thanks
    95
    Thanked 128 Times in 125 Posts
    RetiredGeek, it's all yours! My beginner's BATchfiling recognizes that many things can be done, however, I don't know nearly enough to accomplish what OP desires.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  12. #10
    5 Star Lounger
    Join Date
    Mar 2011
    Posts
    820
    Thanks
    16
    Thanked 62 Times in 57 Posts
    Here is one intriguing idea, if only because it might be useful to those of us who are not subject to the constraint of prohibiting third-party software. Can anyone think of any third-party software that might perform such a service, and then, without reverse-engineering, take that as an inspiration for a means for performing the operations sought in the OP? Obviously I'm curious to know what third-party means are available, but reviewing them might suggest one or more alternative means for doing it within Windows.

  13. The Following User Says Thank You to dogberry For This Useful Post:

    leeroysilk (2015-05-26)

  14. #11
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,729
    Thanks
    95
    Thanked 128 Times in 125 Posts
    My first guess is any VBS script with an icon pointing to it that is written by RetiredGeek will work.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

  15. The Following User Says Thank You to RolandJS For This Useful Post:

    leeroysilk (2015-05-26)

  16. #12
    5 Star Lounger
    Join Date
    Mar 2011
    Posts
    820
    Thanks
    16
    Thanked 62 Times in 57 Posts
    Quote Originally Posted by RolandJS View Post
    My first guess is any VBS script with an icon pointing to it that is written by RetiredGeek will work.
    Touché.

  17. #13
    5 Star Lounger
    Join Date
    Jan 2004
    Location
    Praha
    Posts
    988
    Thanks
    56
    Thanked 105 Times in 90 Posts
    If these are Word documents, why not write some VBA to do what you are looking for at the time of saving ?

  18. The Following User Says Thank You to MartinM For This Useful Post:

    leeroysilk (2015-05-26)

  19. #14
    Lounger
    Join Date
    Aug 2014
    Posts
    31
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Well, as much as I would like to see this one through, my organisation has now decided they don't want to do this, so I wont take up any more of your guys times with this.

    I would however like to thank you all for your inputs. Cheers everyone

  20. #15
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,729
    Thanks
    95
    Thanked 128 Times in 125 Posts
    LeeRoy, why not keep at it with us until you succeed? That way, if the Corp changes its mind, you will be ready to rock & roll.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/

Page 1 of 2 12 LastLast

Posting Permissions

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