- delete all files and folders on external drive before backup
- Posted by jawdoc on May 19th, 2007
I need a batch file or script to run prior to a backup that will
delete all file, folders and subfolders on an external drive "e:\"
prior to a backup "copy" job to this drive.
any help is greatly appreciated!
- Posted by Todd Vargo on May 19th, 2007
"jawdoc" <drbrooks@msoms.com> wrote in message
news:1179547482.593241.150660@k79g2000hse.googlegr oups.com...
Please read the help from the DEL/? command.
BTW, for anyone not aware, there are groups specifically for NT/2K/XP
related batch discussions. Here are 2 such groups...
<news:alt.msdos.batch.nt>
<news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
And if you don't have access to those, try...
<http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
- Posted by scripts.contact on May 19th, 2007
On May 18, 10:35 pm, "Todd Vargo" <tlva...@sbcglobal.netz> wrote:
Can DEL delete folders ??
To OP:
*TRY*:
for /d %t in (e:\*) do rd /s /q "%t"
- Posted by Todd Vargo on May 19th, 2007
scripts.contact wrote:
Good point.
That will not delete files in the root of e:
The following removes everything from drive E: in OP's OS but now the point
of having OP read /? help is lost.
rd /s /q e:\
BTW, for anyone not aware, there are groups specifically for NT/2K/XP
related batch discussions. Here are 2 such groups...
<news:alt.msdos.batch.nt>
<news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
And if you don't have access to those, try...
<http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
- Posted by Timo Salmi on May 19th, 2007
jawdoc <drbrooks@msoms.com> wrote:
Since this posting is in alt.msdos.batch assume MS-DOS+Win../95/98/Me
HELP DELTREE
Use prudently.
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Useful batch files and tricks ftp://garbo.uwasa.fi/pc/link/tsbat.zip
- Posted by foxidrive on May 19th, 2007
On Sat, 19 May 2007 08:56:30 +0300, Timo Salmi <ts@uwasa.fi> wrote:
FORMAT E: /Q /U
Use more prudently. 
- Posted by Roberto Montaruli on May 19th, 2007
foxidrive ha scritto:
I was going to suggest the same solution, but FORMAT is interactive and
prompts for confirmation.
So you have to write
ECHO Y | FORMAT E: /U /Q
...but after formatting, my batch seems to have something wrong with
input/output.
I don't know.
- Posted by foxidrive on May 19th, 2007
On Sat, 19 May 2007 14:42:22 +0200, Roberto Montaruli
<rmontaruli@yahoo.com> wrote:
I had forgotten, it has been so long, but now you remind me I think it
requires more than a Y. When you've piped a single Y into format then the
program looks for further input from the same stream so input seems to
lockup.
The general technique is to echo all the responses into a file and redirect
that file into format:
untested:
echo y>response.txt
echo.>>response.txt
echo n>>response.txt
format e: /q /u <response.txt
del response.txt
- Posted by Timo Salmi on May 19th, 2007
Roberto Montaruli <rmontaruli@yahoo.com> wrote:
Try dropping the space before |
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html