First time asking here so apologies if the title is a bit confusing.
I am trying to make a batch file to delete all files within a folder and within that folder's subfolders.
So far, this is my batch code:
@echo off
:home
cls
color 02
title STUDENT FILE CLEAN SLATE PROTOCOL
echo Where are the files to be deleted?
call selectFolder.vbs
set %1=objFolder
cd %1
cls
color 02
echo Deleting...
del *.* /q /s
goto done
:done
echo.
echo Deleting process is now complete
echo Press Enter to close this program
pause > nul
exit
:empty
cls
echo You did not specify a directory
echo Please try again
pause > nul
goto home
And this is my VBScript code:
Dim objShell
Public objFolder
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Please select the folder.", 1, "")
shell.run "delete.bat objFolder"
The VBScript code isn't fully done. I am having an error at line 5, char 1 so that's the shell.run part. I'm getting an Object required error. May I know how can I fix this and still how to push the value of objFolder to my batch file?
UPDATE: I've decided to focus this batch code to just delete files. Gonna make a separate batch file to deal with the remnant folders after file deletion inside.