Question Locked

FTP using VBS script failed to copy files when executed as SQL 2000 job...

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

...but succeed when run manually at command prompt..

We have a vbs script that access an ftp sites and ftp some files. This vbs script is executed using SQL job via xp_cmdshell and cscript. After we upgrade the server from Win server 2000 to 2003, the job execute the vbs but no file is being ftped to the server. but when executed manually using cmd prompt and cscript, the files are being copied.

any thoughts will be appreciated. Let me know if you need more info.

these are the object being used in FTP:

' Create objects
Set wsh = CreateObject("Wscript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")

is there any incompatibility on these objects to win Server 2003? I am not sure why it is not working when executed as SQL job but OK when executed manually.

5 replies

by tony hopkinson

that xp_cmdshell is running under at a guess.

if you are doing it out of SQL Agent in teh scheduler, then it will be the permisions of the account the agent sevice is ruuning at.

by fqies_bry

I also executed the vbs script in CMD using the agent account,(which is supposedly the same as what the scheduled job do) and the files are ftped successfully. the ftp is not working properly only when scheduled. any thought?

by tony hopkinson

Is there evidence that the script is executing at all from the scheduler.
Moving a file, writing a log or somesuch?

by fqies_bry

Yes.. the vbs has it's own logging mechanism like writing lines in a text file and all those are working... only the file is not ftped from the ftp site to a folder where the it should be dumped.

This discussion is closed to new replies.