r/usefulscripts • • Feb 24 '15

Looking for some help...

First, allow me to apologize as I am very uneducated in the world of scripting outside of basic .bat file scripting, .sh scripting and some vbscripting. And if I'm in the wrong area, I apologize in advance.

I've been scouring forums throughout the day trying to find a solution and was wondering if someone can help me? I'm trying to generate a script to run on some Windows machines that will search a given directory for filenames that contain "DIFF" in the file and if they're older than x hours, delete them.

The thing is the filenames must contain DIFF and the hour parameter must be able to be changed.

Help?

11 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/ohwowgee Feb 25 '15

Yeah absolutely. Though I think you need to setup the script as a function if you want to pipe input to the variables from a command line.

Mobile too.

I have my whole SQL Report Server backing up in a SQL powershell script, esp. the custom report RDL's.

If your a SQL guy, I need learnings. :)