write a script for 2003 R1 to remove files.. help??

  • Thread starter Thread starter A W
  • Start date Start date
A

A W

Guest
I need to write a script that will search for and delete files in the user
data folders.
Im seeing MP3s and such turn up on the system.
I have no budget to upgrate to R2 and no budget to buy software.
Next best thing is a script.
But I have never written script for server before.
So, uh... help!?
 
Re: write a script for 2003 R1 to remove files.. help??


"A W" <AW@discussions.microsoft.com> wrote in message
news:8A401BFF-3C3B-4158-9425-F96BD0D6645E@microsoft.com...
>I need to write a script that will search for and delete files in the user
> data folders.
> Im seeing MP3s and such turn up on the system.
> I have no budget to upgrate to R2 and no budget to buy software.
> Next best thing is a script.
> But I have never written script for server before.
> So, uh... help!?
>


You don't really need a script - a plain Console command will do:

del /s "d:\User Files\*.mp3"

That's all! Knowing some basic console commands is a very handy
thing for a server administrator. If you need to this sort of thing
regularly then you can put your commands into a batch file like so:

@echo off
del /s "d:\User Files\*.mp3"
del /s "d:\User Files\*.avi"
del /s "d:\User Files\*.wme"

or perhaps like so:

@echo off
for %%a in (mp3 avi wme) do del /s "d:\User Files\*.%%a"
 
Re: write a script for 2003 R1 to remove files.. help??

D'Ho!

A console command! LOL

A batch file would work fine. I can set that up to run every hour or so.
(or perhaps once, right before the backup).

thanks Pegasus.

Any good sites on Scripting though?.
Maybe I should learna little scripting anyway...

"Pegasus (MVP)" wrote:

>
> "A W" <AW@discussions.microsoft.com> wrote in message
> news:8A401BFF-3C3B-4158-9425-F96BD0D6645E@microsoft.com...
> >I need to write a script that will search for and delete files in the user
> > data folders.
> > Im seeing MP3s and such turn up on the system.
> > I have no budget to upgrate to R2 and no budget to buy software.
> > Next best thing is a script.
> > But I have never written script for server before.
> > So, uh... help!?
> >

>
> You don't really need a script - a plain Console command will do:
>
> del /s "d:\User Files\*.mp3"
>
> That's all! Knowing some basic console commands is a very handy
> thing for a server administrator. If you need to this sort of thing
> regularly then you can put your commands into a batch file like so:
>
> @echo off
> del /s "d:\User Files\*.mp3"
> del /s "d:\User Files\*.avi"
> del /s "d:\User Files\*.wme"
>
> or perhaps like so:
>
> @echo off
> for %%a in (mp3 avi wme) do del /s "d:\User Files\*.%%a"
>
>
>
 
Back
Top