Hi all, needed help: How to make commands with wildcard combination to delete a folder
I always use a batch file to easily remove unnecessary files in %TEMP% that I put on my Startup in Startmenu.
But I had trouble using a combination wildcard asterisk(*) to delete a folder with its name contains a dot(.) mark.
Here's details, if I open Photoshop CS6, there always made 8-9 useless files (files + folders) in profile Temp. There is no problem to remove all by using batch file, but there is one obstacle for me to remove using asterisk to a folder as the name lilo.3248.
Actually, it's so easy to remove if I use full name, example:
@echo off
if exist %TEMP%\lilo.3248 rd /s /q %TEMP%\lilo.3248 => works without problem
But it's a problem if I try using wildcard(*), like this:
@echo off
if exist %TEMP%\lilo.* rd /s /q %TEMP%\lilo.* => failed
if exist %TEMP%\li*.* rd /s /q %TEMP%\li*.* => Same failed
Why I use wildcards.. because the figures after the dot could always be changed to a new numbers each time when I open new Photoshop, sometimes 3digits, sometimes 4digits erratically. The numbers were created randomly as lilo.743, lilo.2935 etc.. Therefore I use wildcards to be easier, but failed.
In general, for directory name without dot + wildcard, I usually can remove them easily. But, this method not work to this case.. confused.
So, does anyone know how to make the commands work according to my needs like above? Thanks in advance.