Page 1 of 1

Script with folder variable name (in path)

Posted: 04 Nov 2022 06:10
by enermax31
Hello,

I need your help....

I'm writing a simple script to clean temporary files of a software named ACE.

Temporary files are stocked in "%programdata%\ACE_Trainers\ACE_350\4.2.0\Tracking\*.xml"

My problem: As you can see in the path, there is a folder named with the version (4.2.0). I would like to do like for files and use : "%programdata%\ACE_Trainers\ACE_350\*.*.*\Tracking\*.xml"


How can i do that? Any ideas?

Thank you for your help :-)

Re: Script with folder variable name (in path)

Posted: 04 Nov 2022 10:24
by aGerman
You need to do this in two steps. Something about like that night work for you.

Code: Select all

for /d %%i in ("%programdata%\ACE_Trainers\ACE_350\*.*.*") do del /q "%%~i\Tracking\*.xml"
Steffen