Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Move or delete files

  • 19-05-2017 12:05AM
    #1
    Registered Users, Registered Users 2 Posts: 521 ✭✭✭


    I have a list of files with full pathname. And am looking to find out is there any tool or way of automating this either to move e the files or to delete them if possible


Comments

  • Registered Users, Registered Users 2 Posts: 1,929 ✭✭✭PrzemoF


    Probably you're not a linux user, but maybe windows have something similar to a shell (PowerShell??). Anyway, linux version would be:
    for F in $(cat file_list_here) ; do  rm "$F" ; done
    


  • Closed Accounts Posts: 22,461 ✭✭✭✭beauf


    I think I do this in DOS. Command line etc. But I think I have to move them to the root directory.

    I think you are referring to the Windows bug where it can't move or delete files with really long file names.

    Super weird this bug exists.


  • Registered Users, Registered Users 2 Posts: 11,087 ✭✭✭✭28064212


    Assuming you have a file at c:\dev\delete.txt with the files to be deleted like this:
    C:\dev\test\a.txt
    C:\dev\test\b.txt
    
    Then open up Powershell and run:
    get-content c:\dev\delete.txt | foreach-object {remove-item $_ -whatif}
    

    That shows you a dry-run (what would be deleted). To actually delete the items, just remove "-whatif"

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, dark mode, and more). Now available through your browser's extension store.

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



Advertisement