Get problem

Advertisement

hagh
Joined:
Posts:
4

Get problem

I can not get the file that I am looking for and this is my code in a ASP page:
Set oFTPScriptFSO = CreateObject("Scripting.FileSystemObject")
Set oFTPScriptShell = CreateObject("WScript.Shell")
sLocalPath = "c:\Inetpub\wwwroot\ftptext\"
sFTPScript =
" option batch on
option confirm off
option transfer binary
open sftp://cab:Ei&2a$x@ftp.one.com
cd /Home/
get TEXT.TXT
close
exit
"

sFTPTempFile = "C:\Inetpub\wwwroot\Test\tttt.txt"
Set oFTPScript = oFTPScriptFSO.CreateTextFile(sFTPTempFile, True)
oFTPScript.WriteLine(sFTPScript)
oFTPScript.Close
sCmd = """C:\Program Files\WinSCP\WinSCP.com"" -script=" & sFTPTempFile
sout1 = oFTPScriptShell.run (sCmd, 1, true)
Set oFTPScript = Nothing

what is my problem?
Please let me know - Thanks

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Get problem

Does it work if you execute the script separately? Can you post a log file and/or output of the script? Have you read the FAQ?

Reply with quote

hagh

Re: Get problem

Yes, I have looked at all the FAQ and No I don't have any log file. What should I log to find the problem?

My shell.run returns 1, and there is no error. I just cant get (download) my file. I can use the Winscp control panel to get that file directly, but I can't via VB script.

Reply with quote E-mail

hagh
Joined:
Posts:
4

thanks for the reply
Yes, When I run a batch file (locally on the webserver machine) with a call to vbscirpt text file, it works. But when I run the ASP page with the same code, it doesn't work. Here are the two files that work together:

1- Batch file:
"C:\Program Files\WinSCP\WinSCP.com" -script=C:\Inetpub\wwwroot\Test\tttt.txt

2- The vbscript(tttt.txt):
option batch on
option confirm off
option transfer binary
open sftp://ca:Ei3&29a$b@ftp.one.com:22
get TEXT.TXT C:\Inetpub\wwwroot\Test\
close
exit

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar

Then you should read the mentioned FAQ once again. I'm pretty sure it describes your problem. Otherwise I need to see the log.

Reply with quote

hagh
Joined:
Posts:
4

I can not open the conection. When I run the batch file from that machine, it works fine, but when I run it from webpage, using IIS server, it doesn't. The batch file works. It does other stuff, but the open conection comand doesnt work. Please tell me which log file you need so I can send it to you.
Thanks - Hamid
hamid.ghasemiyeh@gmail.com

Reply with quote E-mail

Advertisement

You can post new topics in this forum