Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Using VBScript to Automate Tasks Expand / Collapse
Author
Message
Posted Thursday, June 2, 2005 3:02 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 8:22 AM
Points: 21, Visits: 100

Is this in a .BAT or .SCR file?

Post #187243
Posted Monday, July 11, 2005 8:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 25, 2007 7:46 AM
Points: 1, Visits: 1

I just want to say thank you for posting this article.  It was real easy to read, understand and modify for my own use.  There are a lot of coders out there that can write really good code, but it takes another skill to write code as you have done that is easy to read and adapt.

 

Thanks,

Ben

Post #199375
Posted Saturday, October 15, 2005 9:37 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, January 18, 2013 11:03 AM
Points: 55, Visits: 60
Wow, I never thought that my little article generated so many great feedbacks! I learned so much from you all!!!

Sorry for the late reply to all you guys. I've been busy with other things and have neglected checking back the forum from time to time.

Thanks again.



Post #229207
Posted Monday, April 10, 2006 6:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 3, 2006 5:51 AM
Points: 3, Visits: 1

Forfiles is a little known command that is great for iterating over a number of files that meet a condition, it's available in both 2000, XP and 2003 but there are different versions out there depending on servicepack version.  

For example, I use it in a backup script to remove local backups when they have been moved to network drive:

' Delete cab files older than 3 days in local folder
oWshShell.Run "FORFILES /p ""C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"" /m *.cab /d -3 /c ""cmd /c del @file""" , 0, True

For all command line options run FORFILES /? on the command prompt.

Post #272171
Posted Monday, April 10, 2006 7:53 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, January 18, 2013 11:03 AM
Points: 55, Visits: 60
Very cool pl! Thanks for sharing.


Post #272373
Posted Friday, September 22, 2006 5:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 11, 2006 9:39 AM
Points: 2, Visits: 1

The following questions are for script#2.

1) When the FTP script is run, what does the '-s' represent, send a single file?

2) Is there a way to make the DOS screen freeze when the FTP script is being run?  I've tried 'pause', 'prompt', 'echo', etc. but nothing seems to work.

3) How can a logfile be created when the FTP script is run?  I've used the Chr to put the ascii '>>' characters in but a logfile is not created.

Thanx!     Warren

          

Post #310507
Posted Friday, March 7, 2008 8:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 11, 2010 7:39 AM
Points: 1, Visits: 29
I need this funcionality, but I have not done VBScript with SQL Server before.
Where do you put this code? Do I bring up SQL Mgmt Studio and then what?
Can you point me to a resource?
Thanks. CW
Post #465887
Posted Friday, March 7, 2008 8:17 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 8:26 AM
Points: 775, Visits: 1,203
Pretty cool neat VBS
I am playing with them already

I suppose SSIS/Batch can work equally well for the same thing


SQLServerNewbie

MCITP: Database Administrator SQL Server 2005
Post #465898
Posted Friday, March 7, 2008 8:19 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, January 18, 2013 11:03 AM
Points: 55, Visits: 60
You can put it in a Sql Server Agent job. Create a new job, go to steps, and pick ActiveX script from the dropdown.


Post #465900
Posted Friday, March 7, 2008 8:57 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:56 AM
Points: 3,924, Visits: 1,607
Delete files in a folder that are certain days old script is worth keeping in personal briefcase. Thanks for a good article.


SQL DBA.
Post #465942
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse