I am trying to write a batch file to delete a file within a specific directory based on a file the user puts in. So if the file Helloworld.txt is in the directory C:\Users\Users\Desktop. A user can type the file Helloworld.txt and it will be deleted. The script I have right now is
set input=
set /p input= Choice:
if EXIST C:\Users\User\Desktop\Server\Plugins\%input% del
pause
exit
Anyone have solutions?
please test %echo off
cls
echo PLEASE ENTER A FILE NAME WITH EXTENSION(EG: helloworld.txt):starts
set /p input= Choice:
if EXIST C:\Users\User\Desktop\Server\Plugins\%input% del C:\Users\User\Desktop\Server\Plugins\%input% && GOTO complete
echo invalid choice, please make another
goto starts:complete
echo THANKYOU! please type ENTER to end
pause
exitmike
| « Bactch to delete 5 0's fr... | extract data from text fi... » |