INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

run active x script by scheduled task

run active x script by scheduled task

(OP)
hi i have created an which is running perfectly under a ssis package with the desired output , but i tried executing it as a windows scheduled task and eventhough it runs with no errors it does not do anything.

'************************************************* ***********
' Visual Basic ActiveX Script
'************************************************* ***********

Function Main()

Dt = now()

y = Right(Year(Dt),2)
m = Month(Dt)
d = Day(Dt)

If Len(m) = 1 Then
m = "0" & m
End If

If Len(d) = 1 Then
d = "0" & d
End If

Filename= m & d & y & ".txt"


SFile ="C:\archive\"

DFile ="C:\archive\"


SFile1 = SFile &"UtilityDB_log_"& Filename
SFile2 = SFile &"Distributor_log_"& Filename



DFile1 =DFile & "UtilityDB_log.txt"
DFile2 =DFile & "Distributor_log.txt"



Set FSO = CreateObject("Scripting.FileSystemObject")



If (FSO.FileExists(DFile1)) Then


Set NewFile = FSO.GetFile(DFile1)
NewFile.Copy(SFile1)
FSO.DeleteFile(DFile1)


End If

If (FSO.FileExists(DFile2)) Then

Set NewFile = FSO.GetFile(DFile2)
NewFile.Copy (SFile2)
FSO.DeleteFile(DFile2)

End If




Set FSO = Nothing
Main = DTSTaskExecResult_Success
End Function






I do have all the permissions to do this delete(when executing the ssis i used my login and when scheduling windows task i use my credentials)

this is what i did.

I have the script saved as a c:\temp\scripts\rename.vbs

i went to schedule tasks, under run i clicked browse and choose my vbs file, added my login. It runs fine but like i said it does not return any outputs.


Can someone tell me what am i doing wrong.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close