Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've built my own simple object for this, I get a lot of reuse out of it, I can wrap it with a <code>cmdline</code>, <code>web page</code>, <code>webservice</code>, write output to a file, etc---</p> <p>The commented items contain some <code>rsync</code> examples--</p> <p>what I'd like to do sometime is embed <code>rsync</code> (and <code>cygwin</code>) into a resource &amp; make a single .net executable out of it--</p> <p>Here you go:</p> <pre><code>Imports System.IO Namespace cds Public Class proc Public _cmdString As String Public _workingDir As String Public _arg As String Public Function basic() As String Dim sOut As String = "" Try 'Set start information. 'Dim startinfo As New ProcessStartInfo("C:\Program Files\cwRsync\bin\rsync", "-avzrbP 192.168.42.6::cdsERP /cygdrive/s/cdsERP_rsync/gwy") 'Dim startinfo As New ProcessStartInfo("C:\Program Files\cwRsync\bin\rsync", "-avzrbP 10.1.1.6::user /cygdrive/s/cdsERP_rsync/gws/user") 'Dim startinfo As New ProcessStartInfo("C:\windows\system32\cscript", "//NoLogo c:\windows\system32\prnmngr.vbs -l") Dim si As New ProcessStartInfo(_cmdString, _arg) si.UseShellExecute = False si.CreateNoWindow = True si.RedirectStandardOutput = True si.RedirectStandardError = True si.WorkingDirectory = _workingDir ' Make the process and set its start information. Dim p As New Process() p.StartInfo = si ' Start the process. p.Start() ' Attach to stdout and stderr. Dim stdout As StreamReader = p.StandardOutput() Dim stderr As StreamReader = p.StandardError() sOut = stdout.ReadToEnd() &amp; ControlChars.NewLine &amp; stderr.ReadToEnd() 'Dim writer As New StreamWriter("out.txt", FileMode.CreateNew) 'writer.Write(sOut) 'writer.Close() stdout.Close() stderr.Close() p.Close() Catch ex As Exception sOut = ex.Message End Try Return sOut End Function End Class End Namespace </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload