Help with creating a batch file


Recommended Posts

I tried to create a simple one line batch file that does del "path" *.jpg /s, but when I run it, it wants to del *.*, not *.jpg. The only way I have currently bypass this is is to use find in explorer. But that involves a few more steps. Is there any reason that that simple command structure is not working right? It's Windows 10.

Link to comment
https://www.neowin.net/forum/topic/1421588-help-with-creating-a-batch-file/
Share on other sites

If you do it manually does it work?  as in:

 

dir /s "c:\path\to\directory\*.jpg" (to list)

del /s "c:\path\to\directory\*.jpg"

 

Powershell (Yes, not a .bat file, but .ps1)

 

Remove-Item 'c:\path\to\directory\*' -recurse -include *.jpg -whatif  (note: the -whatif lists the files it would delete).

 

  On 19/09/2022 at 01:10, jnelsoninjax said:

The exact command I used was: del "C:\Program Files\Agent\Media\WebServerRoot\Media\video" *.jpg /s

Expand  

Use:

del /s "C:\Program Files\Agent\Media\WebServerRoot\Media\video\*.jpg"

  • Thanks 1
  On 19/09/2022 at 01:10, jnelsoninjax said:

The exact command I used was: del "C:\Program Files\Agent\Media\WebServerRoot\Media\video" *.jpg /s

Expand  

 

del /s "C:\Program Files\Agent\Media\WebServerRoot\Media\video\*.jpg"

 

That will delete all .jpg under video and any subdirectory.

  • Like 1
  • Thanks 1
  On 19/09/2022 at 01:13, Jim K said:

 

del /s "C:\Program Files\Agent\Media\WebServerRoot\Media\video\*.jpg"

 

That will delete all .jpg under video and any subdirectory.

Expand  

OK, I'll try that, thanks. That worked! I guess I haven't done enough with the command line in the newer versions of Windows (I grew up using DOS and Win 3.1)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Chrome is now faster than ever and Google explains how it did it by Sayan Sen Back in June last year, Google touted some great performance improvements for Chrome and shared a blog post explaining in detail how it managed to achieve them. Today, almost exactly a year later, the search giant is back again with another such post as it continues to make performance gains in its Chromium browser. Interestingly, Google is not the only one to make such claims in recent times. Microsoft also highlighted recently how Edge was getting significantly faster. Both Microsoft and Google have cited the Speedometer 3.0 benchmark to test. We recently measured browsing performance during our T-Force DDR5-7200 RAM review, also using Speedometer 3.0. In its blog post, Google says that the development team made significant improvements to memory management and caching. This includes some redesigning effort of the memory layouts for many internal data structures used in components such as DOM, CSS, layout, and painting. Google says that Blink, the rendering engine in Chromium, now "avoids a lot of useless churn" so as to make better use of the CPU caches. In the areas where memory handling previously relied on garbage collection in Oilpan, like the DOM (document object model), the team has expanded that by shifting from using malloc (memory allocation function) to Oilpan entirely. For those wondering, Olipan is the garbage collector in Blink. Some of the memory management and caching improvements Google made are fundamental to good code optimization. If you recall, recently, a senior Microsoft engineer also pointed out many of these issues in apps that slow Windows down. There are also improvements in handling strings within the renderer; the hashing method was updated to rapidhash, which is said to improve performance. For when rendering tasks become inherently expensive, such as computing CSS styles for various elements, Google adds that caching techniques have been enhanced to achieve higher cache hits and fewer misses.
    • Laptop users, this appears to be single-sided so it should fit even in cases with thin slots.
    • Apple wouldn't be what it is today without China either...
    • I am struggling with the game, after playing it again after so many years.... feels so out of space.
  • Recent Achievements

    • Week One Done
      Uranus_enjoyer earned a badge
      Week One Done
    • Week One Done
      jfam earned a badge
      Week One Done
    • First Post
      survivor303 earned a badge
      First Post
    • Week One Done
      CHUNWEI earned a badge
      Week One Done
    • One Year In
      survivor303 earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      428
    2. 2
      +FloatingFatMan
      195
    3. 3
      snowy owl
      191
    4. 4
      ATLien_0
      184
    5. 5
      Xenon
      141
  • Tell a friend

    Love Neowin? Tell a friend!