Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SO I have a uninstall bat file for my program the thing is my bat file will not delete other folders if there are sub folders inside of it. Plus I don't know the name of the sub folders so how do I make it so it will delete the files and subfolders inside of 1main folder?

Uninstall.bat
PHP
@echo off

:main
echo are you shure you want to remove backup maker?
set /p yn=(Y/N)
if %yn%== Y goto yup
if %yn%== y goto yup
if %yn%== N goto nine
if %yn%== n goto nine

:undef
echo invalid choice.
goto :main

:nine
exit

:yup
echo removing
del logs\backupdata.txt
rd backups
rd logs
del Backup_maker.bat
pause
DEL "%~f0"
Posted

1 solution

You can use the rd or rmdir commands with the /s switch:

rmdir/rd command[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900