In: Computer Science
IIf this is for windows 10, there is no verbose mode delete files. prompt is available. but chose to ignore as redirecting output to file. instead I wrote delete messages to output file. let me know if any changes required.
If you want it in Bash, let me know.
@echo off
REM Creating directory CIS153
mkdir CIS153
REM changing PWD to CIS153
cd CIS153
REM Read input file from user
set /p input= "Enter Input file: "
REM For each entry in input file
for /f "delims=" %%a in ('more %input%') do (
REM Create an empty file starts with newFile
type nul > newFile%%a
)
echo "Files Created"
echo "Delete Files?"
REM pausing before deleting file. this will give time
REM to look in to directory
pause
REM move out of CIS153
CD ..
for /f "delims=" %%a in ('dir CIS153 /b /a-d') do (
echo "Deleting " CIS153\%%a >> output.txt
REM Delete files in CIS153
del /Q CIS153\%%a >> output.txt
)
echo "Deleting " CIS153 >> output.txt
REM Delete directory
rmdir CIS153 >> output.txt
echo "Delete completed. Exit?"
pause






