SFTP Library crashing Cscript.exe


I'm having a strange problem where the SFTP library crashes cscript.exe on obj.Connect(). This only occurs when I read the license key from a file (LoadLicenseKeyFile). If I use the LoadLicenseKeyData method from the example:

[indent]If obj.LoadLicenseKeyData(strKey) Then
WScript.Echo "Success"
WScript.Echo "Failed"
End If[/indent]

It always drops to the failed condition and the log file displays (I believe it only continuesbecause the DLL has not expired yet):

[indent]20090811 14:54:56.922 Thread(6860) Log file opened. LogLevel=7
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadData()
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadDataText()
20090811 14:54:56.926 Thread(6860) CLicenseKey::LoadDataXML()
20090811 14:54:56.954 Thread(6860) Log file closed.[/indent]

The LoadLicenseKeyFile method does, however, successfully validates eventhough it causes the crash of Cscript.exe.

I just found the thread below which says to disable Compressions. I uncommented the line oSFTP.Compressions = arCompressions and it seems to work now.

Does it crash with every SFTP server you are trying to connect to?

Is the crash with the oSFTP.Compression = arCompressions call or further down in the .Connect() call?


Hi Mat,

I only tried connecting to a Cygwin SSH server. I'm not sure if the same behaviour would occur if I attempted to connect to a differnt SSH server.

The crash would occur on the obj.Connect() call. Uncommenting that line, oSFTP.Compression = arCompressions, stopped the crash from occuring.

Let me know if you need anymore information.

Thank you for your reply. Can you try to see if it crashes when connecting to another SFTP server?

Did you also try to connect to the same server with the SmartFTP client?


Hi Mat,

Connecting with the SmartFTP client does not cause a crash. I dont have another SFTP server that I can connect to. My company uses Cygwin so that's what I was testing on. If you know of another SFTP server to try i'd be more than happy to test it out.

It looks like I made a mistake. The script keeps producing a Failed Connection error (25) and cannot successfully connect to the SSH server. If I use the simple.wsf script it works, but doesnt work with mine. I've ran it through the debugger and all the settings seem to be correct so I'm not sure why it's failing.

This is all that shows up in the log file:

[20090819 17:29:12] SmartFTP FTP Library v1.5.21.0
[20090819 17:29:12] SSH-2.0-OpenSSH_5.2
[20090819 17:29:12] 2

Is there anyway to get more debugging information?

Ok.. I figured everything out. It was my lack of knowledge of what the MUI file was used for. I didn't realize the file had to be in a en-US subdirectory and had the file on the same level as the DLL. I've tested this and it was the cause of the crash on obj.Connect(). So now my script works whether I have the compression line commented or uncommented.

Sorry for the inconvenience,

No problem. Thanks for the feedback. I will see if we can add an additional check in case the en-us\* files are not where they should be.