Jump to content

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


Recommended Posts

Posted

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!?

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

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"

Posted

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"

>

>

>


×
×
  • Create New...