[batch] help me express/shorten this better

December 27, 2010 at 23:28:53
Specs: Windows 7
del /q "%Public%\Desktop\0*_*.lnk" "%Public%\Desktop\1*_*.lnk" "%Public%\Desktop\2*_*.lnk" "%Public%\Desktop\3*_*.lnk" "%Public%\Desktop\4*_*.lnk"

i wish to delete (00-99)_*.lnk

example of filenames

00_first.lnk
75_middle.lnk
99_last.lnk

.


See More: [batch] help me express/shorten this better

Report •

#1
December 28, 2010 at 01:12:28
@echo off & setLocal EnableDELAYedeXpansion

pushd "%Public%\Desktop"

for /L %%a in (0 1 99) do (
if %%a lss 10 (
del /q 0%%a_*.lnk
) else (
del /q %%a_*.lnk
)
)


=====================================
Life is too important to be taken seriously.

M2


Report •
Related Solutions


Ask Question