Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
themar42
Starting Member
8 Posts |
Posted - 2013-01-11 : 10:40:43
|
Created step in job using vbscript, the step is supposed to copy and move a file to a directory only if the file is a certain size. When I check the job history, it says that "The step did not generate any output. The step succeeded". My problem is that when I go to check the directory the file should have been moved and copied to, the file is not there. I only want the file moved if it contains data, that's why I have the size method in there. See script below:SET filesys=CreateObject("Scripting.FileSystemObject")DIM dDATE DIM FilesysdDATE = DateSerial(Year(Now()), Month(Now()), Day(Now()))valYear = CStr(Year(dDATE))valMonth = CStr(Month(dDATE))valDay = CStr(Day(dDATE))If len(valMonth) = 1 Then valMonth = "0" & valMonthEnd IfIf len(valDay) = 1 Then valDay = "0" & valDayEnd If If filesys.FileExists("\\server123\folder\folder\file.xls") and filesys.size > 14336 Then filesys.CopyFile \\server123\folder\folder\file.xls", "\\server123\folder\folder\folder1\file.xls_" & valYear & valMonth & valDay & ".xls"End If SET filesys = Nothing |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|