-
Oct 18th, 2007, 10:36 AM
#1
Thread Starter
New Member
VB6- How to call a Unix script?
Hi,
I would like to be able to execute a Unix shell script on a remote Unix box from a VB6 Program running on my PC.
I must admit I haven't a clue on how to approach this. I have googled a fair bit with no result on VB6 - although it would seem that this is fairly trivial trivial task if you are using VB.NET.
Could anybody give me a few hints or pointers on how I might go about this ( or better still post the code that will do it! )
Any help would be gratefully received
TIA
dennis alden
-
Oct 18th, 2007, 11:03 AM
#2
Re: VB6- How to call a Unix script?
Thread moved from CodeBank forum (which is for code examples, not questions)
-
Oct 18th, 2007, 04:04 PM
#3
Frenzied Member
Re: VB6- How to call a Unix script?
I can think of 2 possible solutions. I haven't tried either myself so I don't know how difficult they will be to implement.
One option would be to programmatically create a telnet session, log in and send the script command at the command line prompt.
The other option would be to create an ftp session. Again, your program would have to send the login info. Ftp will let you run non-ftp commands by preceeding them with an exclamation mark, i.e. !myscript. Note however that this option may not work depending on the security that has been applied to the server.
-
Oct 19th, 2007, 02:55 AM
#4
Thread Starter
New Member
Re: VB6- How to call a Unix script?
Thanks for the reply ccoder.
I was thinking along the ftp line myself, but I guess I was hoping there would be an easier solution - guess I'll have to roll my sleeves up and get stuck in.
thanks again
dennis
-
Oct 19th, 2007, 07:21 AM
#5
Junior Member
Re: VB6- How to call a Unix script?
Get a hold of an ssh client that allows you to pass a script (or cmd) as a parameter. Not sure if putty does this. Don't get sucked down the ftp/telnet route - they are insecure.
pscp can be scripted to copy files for example, if that's what you need to do and will work with automatic login with public/private keys.
http://chiark.greenend.org.uk/~sgtat.../download.html
Not sure if putty allows calling of script and executing, but if it does then you're golden.
I know the cmd line ssh client in solaris for example will let you do that, there's the equivalent of a secure rsh for example.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|