Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Using rebol for file transfers over Terminal Services

 [1/3] from: james::mustard::co::nz at: 5-Feb-2004 8:26


Had a request from a client today on how to copy photos from a digital camera on their local machine to their Win2k server in another town that they access via MS Terminal Services. After a bit of investigating it seemed you needed ICA or Citrix to allow file sharing between the local and remote machines. We were about to give up when I remembered that terminal services allows text cutting and pasting between sessions. The script below opens a file dialog box from which you can select any number of files (be aware it borks on .lnk files) and then uses Rebol to mold compress them then send to clipboard - then all we needed to do was run a simple do read clipboard:// script on the other end to restore all the files to the local directory. (There is also a view version of this script if anyone is interested) Here's the packaging script: rebol[] ;copy and paste any file(s) over terminal services connections copy-any-files: func [fileblock /local b h f s newfile][ if none? fileblock [return] s: copy "" foreach filename fileblock [ newfile: split-path filename h: "rebol[]^/tfile: do decompress " b: compress mold read/binary filename f: join "^/write/binary %" [newfile/2 " tfile ^/"] append s join h [b f] ] write clipboard:// s ] copy-any-files request-file ;---------------------------------- ;Unpack script: for remote machine / paste destination rebol[] do read clipboard:// ;------------------------------------ Regards, James.<

 [2/3] from: james:mustard at: 5-Feb-2004 8:26


oops! Just realised i was duplicating the rebol[] header - it wont crash things but its messy ;-) ;updated script: rebol[] ;copy and paste any file(s) over terminal services connections copy-any-files: func [fileblock /local b h f s newfile][ if none? fileblock [return] s: copy "rebol[]^/" foreach filename fileblock [ newfile: split-path filename h: "tfile: do decompress " b: compress mold read/binary filename f: join "^/write/binary %" [newfile/2 " tfile ^/"] append s join h [b f] ] write clipboard:// s ] copy-any-files request-file

 [3/3] from: james:mustard at: 5-Feb-2004 8:26


aarrgghhh - I should quit while i'm behind ;-) ;script: ;-------------------------- rebol[] ;copy and paste any file(s) over terminal services connections copy-any-files: func [fileblock /local b h f s newfile][ if none? fileblock [return] s: copy "" foreach filename fileblock [ newfile: split-path filename h: "tfile: do decompress " b: compress mold read/binary filename f: join "^/write/binary %" [newfile/2 " tfile ^/"] append s join h [b f] ] write clipboard:// join "rebol[]^/" s ]<