Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 13, 2019 4:28 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: push binary files to remote Windows system
PostPosted: Fri Jan 28, 2011 8:48 am 
Offline

Joined: Sat Jan 12, 2008 12:54 pm
Posts: 36
Searched forums; found nothing helpful for this.

Running on one system, need to access another in the same network, same admin user ID and password on both systems. My machine is XP Pro; remote is 2003 server; current maint. on both. I need to:
(a) see if a directory exists on the C: drive -- if not, create it
(b) copy some binary files to that directory.

Sounds simple enough, but I can't figure out how to communicate with the remote system.

VBScript is not the answer -- can't handle binary files.

Any hope?


Top
 Profile  
Reply with quote  
 Post subject: Re: push binary files to remote Windows system
PostPosted: Fri Jan 28, 2011 10:42 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
You could make a client-server application. Look up TCPSocket and ServerSocket. You could also probably do it via UDP as well.

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: push binary files to remote Windows system
PostPosted: Fri Jan 28, 2011 10:51 am 
Offline
User avatar

Joined: Mon Apr 26, 2010 9:37 am
Posts: 72
Bob Keeney wrote:
You could make a client-server application. Look up TCPSocket and ServerSocket. You could also probably do it via UDP as well.

There is a nice class kicking around in the examples folder i think that does this with a MD5 checksum. I have it integrated in a filesharing app i am playing with, though if you use it try using SHA-1 instead.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: push binary files to remote Windows system
PostPosted: Sat Jan 29, 2011 2:03 pm 
Offline

Joined: Sat Jan 12, 2008 12:54 pm
Posts: 36
Thanks for the suggestions. I think for this I will abandon REALbasic and try to use FTP.


Top
 Profile  
Reply with quote  
 Post subject: Re: push binary files to remote Windows system
PostPosted: Sat Jan 29, 2011 2:44 pm 
Offline
User avatar

Joined: Wed Mar 15, 2006 7:11 pm
Posts: 700
Roland Foster wrote:
Searched forums; found nothing helpful for this.

Running on one system, need to access another in the same network, same admin user ID and password on both systems. My machine is XP Pro; remote is 2003 server; current maint. on both. I need to:
(a) see if a directory exists on the C: drive -- if not, create it
(b) copy some binary files to that directory.

Sounds simple enough, but I can't figure out how to communicate with the remote system.

VBScript is not the answer -- can't handle binary files.

Any hope?


VBScript is just the "glue" language (among others) that you can use to work with WSH and/or WMI
All the tools are there for you already

You can use RB to give users a nice GUI and use RB's Shell class to execute what you need

_________________
Windows XP + RB2009R2
Windows Vista + RB2009R2
Windows 7 32&64 + RB2009R2
CentOS Linux + RB2009R2


Top
 Profile  
Reply with quote  
 Post subject: Re: push binary files to remote Windows system
PostPosted: Mon Feb 21, 2011 5:33 pm 
Offline

Joined: Wed Jun 28, 2006 8:41 pm
Posts: 136
Location: Colorado, USA
Why not just use the Shell class? With that you can check to see if a file exists and create it if not, and then copy files to it. That is exactly what I do currently. The below code may not work as I am writing from my head right now and dont have RS on this machine. I use this code to push my applicaiton files to the server I have my app on. The servers are all 2003 servers.

dim dest, source as folderitem
dim destSTR, sourceSTR as string
dim sh as new shell

destSTR = "\\servername_or_ip\c$\jerkface" 'UNC path to the folder you want to exist
sourceSTR = Volume(0).Child("Settings") 'location of files you want to push to that folder
dest = GetFolderItem(s) 'see if the folder exists

if dest.Exists = false then
dest.CreateAsFolder 'create folder
sh.Execute "copy " + sourceSTR + "\*.*" dest.AbsolutePath 'copy files from source to your new folder on remote server
sh.Close 'close shell
if sh.ErrorCode > 0 then 'check for errors
MsgBox "There was an error copying the files"
end if
else
dest.Delete 'delete existing folder
dest.CreateAsFolder 'recreate the folder
sh.Execute "copy " + sourceSTR + "\*.*" dest.AbsolutePath 'copy files from source to your new folder on remote server - files are now updated
sh.Close 'close shell
end if


Like I said this is from memory, but the idea is there. I am sure there is a better way to do it, but this way does work. If you have issues with it let me know via PM and I will dog out my actual code that is in production currently.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group