LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2005, 09:13 AM   #1
mrobertson
Member
 
Registered: May 2005
Posts: 275

Rep: Reputation: 30
Executing an ftp command from vb6


Is there any possible way to execute the following command from vb6 every second based on a timer......?

ftp -s:c:\ftp.cmd
 
Old 07-06-2005, 09:53 AM   #2
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Yes. Drop a timer on a form, set it to fire every second (I believe that's a timeout of 1000), and in the timer's event procedure, put
Code:
Shell "ftp -s:c:\ftp.cmd"
It'll probably run in a console window, and it won't wait for FTP to finish before continuing execution. Don't know if that matters, though.
 
Old 07-06-2005, 10:12 AM   #3
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
That worked! I have two other questions for you if you wouldnt mind helping me out.

First. Each time it is executed..another file transfer window appears. Is there anyway around that so that you dont take up so much memory. This program will run all day every day and I can have memory being used like that.

Secondly, the file that I am sending is coming up emptywhat would be the cause of this. here is my code for ftp.cmd:

Code:
open pl7cam3
root
pass
cd etc
get camdata.txt camdata
put camdata
I use ftp -s:c:\ftp.cmd to execute it. when I open the file in windows it is populated but when I go to the camera it is not. Could it be the name change that I tried or what?
 
Old 07-06-2005, 03:42 PM   #4
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
Quote:
Originally posted by mrobertson
Each time it is executed..another file transfer window appears. Is there anyway around that so that you dont take up so much memory.
Not with the shell function. Of course, you're going to be repeating this command constantsly, you could just do it in a batch file. For better control, the alternative would be to send FTP commands to the server using winsock, or the internet transfer control, or some third-party FTP control. Don't ask me for recommendations, though, since I've never done FTP through VB6.

Quote:
I use ftp -s:c:\ftp.cmd to execute it. when I open the file in windows it is populated but when I go to the camera it is not. Could it be the name change that I tried or what?
That could be it. I really don't know. You could always try running each command individually and try to pinpoint where the problem is.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
executing a command at a certain time pantera Programming 6 04-05-2005 12:22 PM
Problem executing from command line jleyba213 Linux - General 4 04-09-2004 12:43 PM
executing from command line nodger Linux - Newbie 3 01-20-2004 10:30 AM
::Command Executing in Webmin:: XxAndyxX Linux - Software 0 03-07-2003 01:04 PM
Executing command lines in C/C++ ReverseLogic Programming 2 05-28-2002 02:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration