-
May 22nd, 2012, 04:35 PM
#1
Remote Server
Hi
Im trying to comunicate with a FTP server,where i want to execute a program,but i don`t know how.
I tryed with psexec..something like this
Code:
Dim command As String
command = Shell("CMD.exe")
Dim systemName As String
systemName = "IP" 'Here im using the IP'
Shell("psexec \\" & systemName & command)
But cmd.exe is opening on my computer..is the first time when im using psexec and i don`t know how..and im not an advanced.
Sorry for my bad english.
-
May 22nd, 2012, 11:12 PM
#2
Re: Remote Server
Use Windows Explorer, type FTP:// and the address of the FTP Server
It will prompt you for the user name/password, and you can remember it.
I have a CMD script that opens the site, I drag a file, and close it for the week.
Works fine.
-
May 23rd, 2012, 03:58 AM
#3
Re: Remote Server
Originally Posted by dglienna
Use Windows Explorer, type FTP:// and the address of the FTP Server
It will prompt you for the user name/password, and you can remember it.
I have a CMD script that opens the site, I drag a file, and close it for the week.
Works fine.
No like that,i wan`t to make a program and when you run it,on that ftp server is runing another program and is register something,and i will know who runned the program,let`s say i want to do it for another pc not for ftp..
How to do it?
-
May 23rd, 2012, 04:11 AM
#4
Re: Remote Server
only solution is to download it from the FTP server, and then run it from the local drive...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
May 23rd, 2012, 04:19 AM
#5
Re: Remote Server
But psexec is only for Lan connections?
The program will be on my site and downloaded by users..and when will run it to run cmd.exe and a 'command' on another pc..
-
May 23rd, 2012, 04:26 AM
#6
Re: Remote Server
FTP: is a File server... It is like having a External HDD , Flash stick or memory card..
YOU CANNOT EXECUTE any code on the Server via FTP.. It is not designed for this, does not allow this and will never do this, ever....
Download and execute from temp folder.
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
May 23rd, 2012, 04:27 AM
#7
Re: Remote Server
Ok,let`s say i wan`t to execute on a pc,please give me an example.
-
May 23rd, 2012, 05:33 AM
#8
Re: Remote Server
Use a FTP Batch Script to download the file then you can use
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
May 24th, 2012, 06:28 PM
#9
Re: Remote Server
Im trying to comunicate with a FTP server,where i want to execute a program,but i don`t know how.
what y want to perform with ftp ?download some files from ftp .upload on ftp or something other ?let me know very exactly .
Use a FTP Batch Script to download the file then you can use
use this method .try the following way .i have been using in hundreds of application .we are no one retail company in Kuwait city .go through the following way .
Code:
Public Function DownloadFile() As Boolean
Dim strMsg$
Dim strLine$
Dim gstrMessage$
Dim processID#
Dim process_handle#
Dim zipapfilepath$
Dim BatchPathLoc As String
Dim DownloadFilepath$
Dim FTPCommandList As String
'------------------------ Authentication--------------------------
DownloadFilepath = "\Inditexx\Download"
Call CheckInditexFolder(DownloadFilepath)
FTPCommandList = strDwnldFilePth & "\FTPCommandList.txt"
Open FTPCommandList For Output As #1
strLine = ""
strLine = "USERNAME" & vbCrLf & _
"PASSWORD" & vbCrLf & _
"ascii" & vbCrLf & _
"prompt off" & vbCrLf & _
"cd /outgoing/articles/" & vbCrLf & _
"mget ART*.ZIP" & vbCrLf & _
"close" & vbCrLf & _
"bye" & vbCrLf
Print #1, strLine
Close #1
BatchPathLoc = strDwnldFilePth & "\FTPDownBatchFile.bat"
Open BatchPathLoc For Output As #1
strLine = ""
strLine = "C:" & vbCrLf & _
"cd " & DownloadFilepath & vbCrLf & _
"C:\WINDOWS\system32\ftp.exe -s:" & FTPCommandList & " ftp1.inditex.com" & vbCrLf
Print #1, strLine
Close #1
'----------------------- Downloading Data with FTP ------------------------------
processID = Shell(BatchPathLoc, vbHide)
process_handle = OpenProcess(SYNCHRONIZE, 0, processID)
'NOT NEEDED--->If process_handle <> 0 Then
WaitForSingleObject process_handle, INFINITE
CloseHandle process_handle
'NOT NEEDED--->End If
gstrMessage = gstrMessage & "Searching for files in <IN> folder" & vbCrLf
'gstrMessageToUser = gstrMessageToUser & "Searching for files in <IN> folder" & vbCrLf
'
' Use your own path instead of \projectFTPData or create this folder on your C drive
'
If Dir$("c:\Inditexx\Download" & "\ART*.ZIP") = "" Then
strMsg = strMsg & "No files on FTP to download" & vbCrLf
MsgBox strMsg
Exit Function
Else
DownloadFile = True
strMsg = strMsg & "Files Downloaded from FTP" & vbCrLf
MsgBox strMsg
End If
End Function
Public Sub CheckInditexFolder(path As String)
If Dir("C:\Inditexx", vbDirectory) = "" Then
MkDir "C:\Inditexx"
End If
If Dir("C:\Inditexx\download", vbDirectory) = "" Then
MkDir "C:\Inditexx\download"
End If
End Sub
Last edited by firoz.raj; May 25th, 2012 at 05:49 AM.
-
May 25th, 2012, 01:29 AM
#10
Re: Remote Server
Originally Posted by firoz.raj
don't use this **** method .try the following way
BE CAREFUL about your language and attitude on the forums..
The AUP (Acceptable Use Policy) is Very Clear on this
*You will not post any Content that is knowingly false, misleading, or inaccurate.
*You will not behave in an abusive and/or hateful manner, and will not harass, threaten, nor attack anyone.
*You will not use profanity
The OP did say..
Originally Posted by TzAkS
....
but i don`t know how
......
and im not an advanced.
And your code is nothing more than an Overly advanced way of doing what was proposed.
Lets look at it..
Code:
FTPCommandList = strDwnldFilePth & "\FTPCommandList.txt"
Open FTPCommandList For Output As #1
strLine = "USERNAME" & vbCrLf & _
"PASSWORD" & vbCrLf & _
"ascii" & vbCrLf & _
"prompt off" & vbCrLf & _
"cd /outgoing/articles/" & vbCrLf & _
"mget ART*.ZIP" & vbCrLf & _
"close" & vbCrLf & _
"bye" & vbCrLf
Print #1, strLine
This code creates a Text file for use as a FTP Batch file with all the commands that are needed by ftp..
Code:
BatchPathLoc = strDwnldFilePth & "\FTPDownBatchFile.bat"
Open BatchPathLoc For Output As #1
strLine = "C:" & vbCrLf & _
"cd " & DownloadFilepath & vbCrLf & _
"C:\WINDOWS\system32\ftp.exe -s:" & FTPCommandList & " ftp1.inditex.com" & vbCrLf
Print #1, strLine
Make a Batch command file to execute FTP.
[code]processID = Shell(BatchPathLoc, vbHide)[/quote]
Use Shell to execute the batch files....
Hmmmm ... EXACTLY the same as was proposed... just made very complicated..
and looking back at your comment, seems you Shot down the exact method your using anyway, so i have no idea how you can claim,
Originally Posted by firoz.raj
we are no one retail company in Kuwait city
...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
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
|