Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH connection using vbscript

Status
Not open for further replies.

BoostMR2

IS-IT--Management
Jul 20, 2007
33
0
0
US
Has anyone successfully created an ssh session using vbscript? I can only assume there is support for ssh connection in the .net framework of windows, but I cannot find any sample code for this. Basically I will be running the script from a client box, and it needs to connect to an ssh server. If anyone knows of a link or simply has some sample code that shows an ssh object from .net, I can use that. Thank you!
 
I can use putty, but how would i utilize putty via vbscript? I suppose it is possible by using putty command line, make a wscript.shell object, pipe it the putty ftp commands. I can do that. Out of curiosity, any other ways, maybe something built into .net? I'd be surprised if .net didn't have ssh support.
 
No, .Net won't help you here.

PuTTY doesn't have "FTP commands" so it is hard to imagine what you're trying to do. Maybe trying to run an FTP client at the SSH server?

PLink is a more likely candidate here. You could WShell.Exec PLink and then control it via the StdIO streams as needed.

The tricky part is that the session will probably involve some sort of VTxxx emulation. This means any data/responses returned will be wrapped and embedded with VT escape sequences:
Code:
?[1;1H?[1;1HMicrosoft Windows XP [Version 5.1.2600]?[1;40H?[2;1H(C) Copyright 19
85-2001 Microsoft Corp.?[3;1H?[4;1HC:\WINDOWS\system32>?[4;21H?[4;23H?[4;1HC:\WI
NDOWS\system32>cd?[4;1HC:\WINDOWS\system32>cd \?[4;25H?[5;1H?[6;1HC:\>?[6;5H
It depends on your SSH server and the shell it defaults to and whether or not the server/shell defaults to a VT terminal type.

Are you really trying to use SFTP from your script? PSFTP is part of the PuTTY suite, and unlike the Microsoft FTP client it can be controlled via StdIO streams.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top