|
Answer» Hi I need a little help to improve my NEW batch to show or delete a numbered TASK names The code below works fine if the task name does not contains a space So i'm looking how can i modify it to read a task name with a space THANK you for any help
Code: [Select]echo off Title Delete Tasks with their time tasks execution by Hackoo 2017 Mode 90,30 & color 0A :Menu cls & echo( echo Type the time with this format "hh:mm" to show or delete for scheduled Tasks SET /a "count=0" set /p "strTime=" cls & echo( SETLOCAL EnableDelayedExpansion for /f "tokens=1 delims= " %%a in ('schtasks /query ^| find /I "%strTime%"') do ( set /a "Count+=1" set "TaskName[!Count!]=%%a" ) Rem Display numbered Task Names for /L %%i in (1,1,%Count%) do ( set "msg=[%%i] - !TaskName[%%i]!" echo !msg! ) echo( Rem Asking the user if he wants to delete or not the numbered task names echo Type the number of the task to delete ! set /p "Input=" for /L %%i in (1,1,%Count%) Do ( If "%INPUT%" EQU "%%i" ( schtasks /delete /tn "!TaskName[%%i]!" ) ) echo( echo Type any key to show and delete another task ! Pause>nul Goto MenuAnswered on DosTips
Quote from: Squashman on November 09, 2017, 06:40:33 PM Answered on DosTips
Thank you very much for your help
|