I am working on a script in batch for deleting files from all directories on my computer. I have the basics laid out, but I've run into an issue. I will put my code below.
But what is happening is that when I run the code I can't make it past the first if-statement, I inserted pauses after each line so I could find out where the problem is and that's how I know this.
What happens when I run the code is that it runs properly, it opens a terminal window, and it prompts the user for input. Immediately after I give the input though, something with the if-statement it close the window.
Thanks in advance for all the help!
The Code
set /p choice=Please enter 1 to continue or 0 to return to menu:
if %choice%==1 (
pause
Set /P inp=Please enter a file name:
pause
for /f %%F in (C:\Program Files)(
if "%%F" == "%inp%" (
goto:remo
)
)
(I haven't finished the code entirely yet, I'm just making sure the parts that I have made run properly.)