Windows 10: Powershell command for deleting everything EXCEPT for...

Discus and support Powershell command for deleting everything EXCEPT for... in Windows 10 Support to solve the problem; Hey guys, just wondered if anyone could help me with this. So basically, I have a directory with a crap ton of subdirectories, each with a crap ton... Discussion in 'Windows 10 Support' started by CursedLemon, Feb 22, 2019.

  1. Powershell command for deleting everything EXCEPT for...


    Hey guys, just wondered if anyone could help me with this.

    So basically, I have a directory with a crap ton of subdirectories, each with a crap ton of files in them. The files all have widely varying names (they're all ZIP files so they have the same extension), and I only want to keep the files with a certain string in the filename.

    What command would allow me to recursively delete every file except for ones containing this string? Is this even possible via command prompt, or perhaps there's a GUI application that could do it?

    :)
     
    CursedLemon, Feb 22, 2019
    #1
  2. Kursah Win User

    PowerShell instead of Commandline in Creators Update

    Interestingly enough my personal laptop just got the update...and still has Command Prompt listed, not PowerShell...

    Edit: Not that it matters...I use both regularly. *Toast :toast:
     
    Kursah, Feb 22, 2019
    #2
  3. Pavan_N Win User
    Uninstall Photo app by using Powershell command

    Hi Lorraine,

    Thank you for posting your response.

    I apologize for the miscommunication. Follow the steps below and check if that helps.


    • 1. Open the Start menu, type Windows PowerShell in the search bar.

      2. Right click on the Windows PowerShell and select Run as administrator.

      3. Enter the below command to uninstall the Photo app.

      • get-appxpackage *Microsoft.Windows.Photos* | remove-appxpackage ( check the spacing)
    After performing the above steps, install the Photo app from the Windows store.

    Hope this information is helpful. Please do let us know if you need further assistance, we’ll be glad to assist you.

    Thanks
     
    Pavan_N, Feb 22, 2019
    #3
  4. H Notneb Win User

    Powershell command for deleting everything EXCEPT for...

    Locked Powershell startup command in context menu

    Since updating to Windows Anniversary Edition, there is an inaccessible Powershell command in my startup context menu.

    There are two keys, one each for 'Directory' and 'Drive'.

    On both the program is listed as "Open Powershell window here",

    and the file command is: powershell.exe -noexit -command Set-Location '%V'



    What is this, and why is it here.

    I have tried to both disable, and to delete it. Both FAIL. Access is denied.



    I have even gone to the registry location and attempted to put a (-) before the default value string.

    This action should disable the item. I have also tried to delete the value string for the entire item.

    With both of these maneuvers I am told that I cannot edit value string.



    I have taken ownership of, and given all users full access to Powershell.exe, and tried all of these step again,

    AND IT STILL WILL NOT DISABLE OR DELETE!!!



    Has anyone else run into this?
     
    H Notneb, Feb 22, 2019
    #4
Thema:

Powershell command for deleting everything EXCEPT for...

Loading...
  1. Powershell command for deleting everything EXCEPT for... - Similar Threads - Powershell command deleting

  2. Powershell command

    in Windows 10 Software and Apps
    Powershell command: Hi How can i get a list via powershell commandof expired users password in AD like this screenshot.Thanks https://answers.microsoft.com/en-us/windows/forum/all/powershell-command/54833831-89ba-4641-a5b2-2d55e848aab8
  3. Powershell command

    in Windows 10 Customization
    Powershell command: Hi How can i get a list via powershell commandof expired users password in AD like this screenshot.Thanks https://answers.microsoft.com/en-us/windows/forum/all/powershell-command/54833831-89ba-4641-a5b2-2d55e848aab8
  4. Powershell command

    in Windows 10 Gaming
    Powershell command: Hi How can i get a list via powershell commandof expired users password in AD like this screenshot.Thanks https://answers.microsoft.com/en-us/windows/forum/all/powershell-command/54833831-89ba-4641-a5b2-2d55e848aab8
  5. Powershell or Command prompt !

    in Windows 10 Software and Apps
    Powershell or Command prompt !: Good morning, I use SCANNOW occassionally going into Command prompt etc. I have just been reading that using it with Powershell is better because it is a more powerful tool would you agree ? Is there anything else you would suggest using with Powershell to keep my laptop...
  6. Powershell or Command prompt !

    in Windows 10 Gaming
    Powershell or Command prompt !: Good morning, I use SCANNOW occassionally going into Command prompt etc. I have just been reading that using it with Powershell is better because it is a more powerful tool would you agree ? Is there anything else you would suggest using with Powershell to keep my laptop...
  7. Powershell command history

    in Windows 10 Gaming
    Powershell command history: Dear Forum,Please clarify the following queries.1 How to retain the command history across Powershell sessions?2 Linux allows increasing the history size using the env variable HISTSIZE. What is the equivalent in WIndows?3 Linux allows prefixing each command history with a...
  8. powershell commands

    in Windows 10 Software and Apps
    powershell commands: I would like a PowerShell ISE command to open a .flac file at a certain time https://answers.microsoft.com/en-us/windows/forum/all/powershell-commands/ea3b6d02-cddd-419d-9ba5-a18f14e67ba5
  9. error in powershell command

    in Windows 10 Customization
    error in powershell command: error in powershell command Getting Hardware Hash Script Command Install-Script -Name Get-WindowsAutoPilotInfo https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409...
  10. Can't open device manager (except through command prompt/powershell)

    in Windows 10 Ask Insider
    Can't open device manager (except through command prompt/powershell): If I search for 'device manager' and hit Enter, nothing happens, clicking the "open" link from the search UI also does nothing. If I manually navigate to device manager in the control panel, again, nothing happens. I click on "device manager" under the devices and printers...