Hi,
I have this piece of code.
SET "NASS=\\abc"
SET "TEMPDIR=%NASS%\CU\OR"
PUSHD "%TEMPDIR%"
forfiles /s /m *.* /c "cmd /c Del @path" /d -90
POPD
While executing, it asks \\abc\CU\OR\*, Are you sure (Y/N) ? and the job stops there till the input is provided.
Now how to pass Y in the above code?
How to pass Yes automatically in a batch script?
Moderator: DosItHelp
Re: How to pass Yes automatically in a batch script?
That's a typical XY question. You don't need to pass Yes but you have to pass /Q as the help for DEL states.
Steffen
Steffen
Re: How to pass Yes automatically in a batch script?
The FORFILES command is grabbing files and folders. When the script tries to delete a folder it will prompt you with that. It will not prompt to delete files.
-
- Posts: 51
- Joined: 10 Jan 2018 15:21
Re: How to pass Yes automatically in a batch script?
correct. Thank you. now i made that silent by passing /Q.