How to write a batch file deleting all files having the same extension

Batch Programming

Hello! I am trying to write a batch program which can delete all files having the same extensions anywhere in my computer location C: and on my desktop. But when it does work.

Here is the first bat file I've done but nothing happen after launching.

@echo off
del "C:\*.vsdx" /s /q

I have programed another one that I've tested:

@echo off
del "H:\*.vsdx" /s /q
del "C: \*.vsdx" /s /q
del "F:\*.vsdx" /s /q
del "Desktop:\*.vsdx" /s /q

Concerning this program, after running it I noticed that .vsdx files in device H and F desappear. But files in the location C: and some others that I've created in Documents do not dissapear. So I'm askinf your help on how to solve this issue.

Summary of problem: I want to write a batch file which can delete all files having the same extension from my computer. Thanks in advance

Edited by Romeo on Reason: Initial post
I don't know what is wrong with first program, but in second program you have space between : and \ for c: disk. Remove that space.
Also I do not think "Desktop:\*.vsdx" is a thing in Windows. You need to put correct path to desktop on c: disk if you want to reference desktop.

Edited by Mārtiņš Možeiko on