Windows 10: is there a way to delete every x number of files via CMD or powershell

Discus and support is there a way to delete every x number of files via CMD or powershell in Windows 10 Support to solve the problem; in a folder I have 300 files (in my case its over 25k). I wish to delete every 20, or every 30 files, or every set pattern of files, how can this be... Discussion in 'Windows 10 Support' started by m18xr2, Nov 15, 2020.

  1. m18xr2 Win User

    is there a way to delete every x number of files via CMD or powershell


    in a folder I have 300 files (in my case its over 25k).

    I wish to delete every 20, or every 30 files, or every set pattern of files, how can this be done?

    things i've tried, using a few selection tool to select every set number of files so I can delete but none has worked on simple ones such as every 20 or every 30 files.

    please help!

    :)
     
    m18xr2, Nov 15, 2020
    #1
  2. M3cael Win User

    Only write one number to log file and delete old ones?

    Hey,

    I'm trying to have some software read from a .text file a number (GPU Temp) but the software will only the first number in a list (Or the first anything)

    Is there a way to have to log file delete the previous entries and write the new number in it's place without any headers?


    EDIT:

    Sorry I'll try again.

    I have some webcam software that can read a number (or whatever) from a text file and then it displays the number as an overlay.

    See here: http://10.244.193.13:8081/

    I was trying to use GPU-z to do this but as it logs as a list the webcam software can't update properly (also it reads the headings of the file and displays them instead)

    Is there anyway to alter the logging to only output just the number (GPU Temp) and to delete the old numbers so the new value is the only value in the file.
     
    M3cael, Nov 15, 2020
    #2
  3. Instructions for deleting files, using CMD

    Hello to the Community,

    Need to delete lots of files; some are large.

    I'm looking for the steps to permanently delete selected files, using CMD (I am NOT a skilled User)

    The standard Delete via File Explorer sometimes doens't work....and/or is very slow to delete.

    Its 2-step operation... to collect, and then delete via the Recycle Bin .... takes
    approximately forever on some files.

    Google research shows me there's some simple ways to use CMD like DEL / RMDIR / /Q /S But I don't know how to use them.

    Could someone send me the specific steps I should enter?

    And also, what is the exact layout/format for defining the file(s) to be deleted, in each CMD string ?

    Thank you,

    Gary
     
    Gary_S_1943, Nov 15, 2020
    #3
  4. M3cael Win User

    is there a way to delete every x number of files via CMD or powershell

    Only write one number to log file and delete old ones?

    Sorry I'll try again.

    I have some webcam software that can read a number (or whatever) from a text file and then it displays the number as an overlay.

    See here: http://10.244.193.13:8081/

    I was trying to use GPU-z to do this but as it logs as a list the webcam software can't update properly (also it reads the headings of the file and displays them instead)

    Is there anyway to alter the logging to only output just the number (GPU Temp) and to delete the old numbers so the new value is the only value in the file.
     
    M3cael, Nov 15, 2020
    #4
Thema:

is there a way to delete every x number of files via CMD or powershell

Loading...
  1. is there a way to delete every x number of files via CMD or powershell - Similar Threads - delete every number

  2. Can you remove VPN credentials via CMD or PowerShell

    in Windows 10 Ask Insider
    Can you remove VPN credentials via CMD or PowerShell: We have clients that use the Built in Windows VPN client. They save their credentials then their password changes and they cannot figure out how to remove the credentials so that they can use the new password. Is there a way to clear the saved credentials for Windows VPN...
  3. How to delete user account with its folder via CMD or Powershell

    in Windows 10 Network and Sharing
    How to delete user account with its folder via CMD or Powershell: I have windows 10 machines with several users on it. I want to delete these user via CMD or Powershell with all their folders desktop, download, ........etc The below command : net user Test /delete only delete the user which is not enough....
  4. Open Cmd via PowerShell, command?

    in Windows 10 BSOD Crashes and Debugging
    Open Cmd via PowerShell, command?: Please i need to open cmd win + r and so i know i need to know how to open it via powershell pls (.bat and so i know it needs to be opened via powershell. Pls PowerShell command to open cmd? Cmd über PowerShell öffnen, Befehl?
  5. Emulate monitor cable disconnect via powershell/cmd

    in Windows 10 Drivers and Hardware
    Emulate monitor cable disconnect via powershell/cmd: Hello, is there a way to make my windows think my monitor was unplugged/plugged again software side? A little bit of background to explain why i'd want to do such a ridiculous thing: My problem is my monitor loses signal upon windows boot. All works fine until just...
  6. Powershell and cmd no network

    in Windows 10 Ask Insider
    Powershell and cmd no network: I got my windows from school try to install choco package manager or adding the repo to power shell . non are working as its saying that there is no internet on both cmd and powershell tried ping and curl its the same. But my browser and other apps have great network . Is...
  7. Is there a way to change wallpaper via cmd/batch file?

    in Windows 10 Ask Insider
    Is there a way to change wallpaper via cmd/batch file?: We're doing a ton of Windows 7 upgrades to Windows 10 (clean installs, not in-place upgrades) and we have a batch file that runs a bunch of stuff as part of the new PC deployment process. Someone else wrote the batch a while back and I'm just trying to improve it a bit. I'd...
  8. Take registry key ownership via CMD or Regini or Powershell

    in AntiVirus, Firewalls and System Security
    Take registry key ownership via CMD or Regini or Powershell: Hi ! I have a little problem. In my workplace we use Win 10 IOT LTSB. I have a task that i must clear the safeboot funkction of the Windows system. I googled for solving the problem, and i get answer that i must change registry key names...
  9. Is there a way to remove a device via cmd?

    in Windows 10 Drivers and Hardware
    Is there a way to remove a device via cmd?: Hi all I want to remove a device from "Devices". (See attachment) I tried using devcon.exe remove using device ID. The output says: it removed 1 device and the Bluetooth device is removed from >"Devices". But as soon as i refresh Device Manager the Bluetooth device comes...
  10. CMD and PowerShell

    in Windows 10 BSOD Crashes and Debugging
    CMD and PowerShell: Hi all, I run Windows 10, v 1803. Clicking Start, typing CMD, there is only "Command Prompt (desktop application)". Win key + X shows "Windows PowerShell" and "Windows PowerShell (Admin)". If after Win key+R I choose Windows PowerShell" pops up a message: Same with...