Need some help...



This will be my very first VB.Net application and it's pretty simple. But
I've got a snag in my syntax somewhere. Was hoping that someone could point
me in the right direction.

The history:
My work involves creating custom packages of our software product for golf
courses that purchase our software. The course data is kept as a back up in
the event the course needs us to replace their custom files. Each course has
a folder of it's own data under a centralized directory.

The problem:
The custom files are going to become a serious storage issue as our customer
base increases.

The solution:
Compress each course folder into an individual .cab file containing all of
the course's custom files and then archive these files to storage media such
as CD/DVD.

Where I need help:
I found some code for implementing a command line window and passing it a
string through a stream. The command window is being instantiated, but the
string is not getting passed or my syntax for running the makecab utility is
off-base. I've spent several hours looking for sample code that would
explain the makecab syntax and I've also tried to determine if the
parameters are being passed in to the Sub correctly. I've set a break at the
line where the string should be passed to the command window, but I can not
seem to get a respnse from the watches that have been set. I've included a
copy of the sub that I'm using to compress the files. If this is not the
correct forum for this, I do apologize. A nudge in the correct direction
would be deeply appreciated.

Private Sub CompressFolder(ByVal ToFolder As String, ByVal FromFolder As
String, ByVal FinalFile As String)

Dim CompressProcess As Process = New Process

CompressProcess.StartInfo.FileName = "cmd.exe"

CompressProcess.StartInfo.UseShellExecute = False

CompressProcess.StartInfo.CreateNoWindow = True

CompressProcess.StartInfo.RedirectStandardInput = True

CompressProcess.StartInfo.RedirectStandardOutput = True

CompressProcess.StartInfo.RedirectStandardError = True

CompressProcess.Start()

Dim stmStreamIn As IO.StreamWriter = CompressProcess.StandardInput

stmStreamIn.AutoFlush = True

Dim stmStreamOut As IO.StreamReader = CompressProcess.StandardOutput

Dim stmStreamErr As IO.StreamReader = CompressProcess.StandardError

stmStreamIn.Write("makecab.exe /L %ToFolder% %FromFolder% %FinalFile%" &
System.Environment.NewLine)

stmStreamIn.Write("exit" & System.Environment.NewLine)

If Not CompressProcess.HasExited Then

CompressProcess.Kill()

End If

stmStreamIn.Close()

stmStreamOut.Close()

stmStreamErr.Close()

End Sub


.



Relevant Pages

  • Re: Need some help...
    ... single .cab file, but it's a bit more complicated that you think. ... Dim _files as String() = Directory.GetFiles ... back up in the event the course needs us to replace their custom files. ... Dim stmStreamIn As IO.StreamWriter = CompressProcess.StandardInput ...
    (microsoft.public.dotnet.languages.vb)
  • Re: inconsistent behavior of >FLOAT
    ... If the string represents a valid floating-point number in the syntax ... if the string does not match the syntax given then false ... ">FLOAT enables programs to read floating-point data in legible ASCII format. ...
    (comp.lang.forth)
  • Re: Just a bit of silliness
    ... Is that the syntax and grammar resemble the stammer ... Can't guess how to copy a string. ... Is the very last} "close curly bracket" ... format strings. ...
    (comp.lang.c)
  • Re: FTS Weighted Values Implementation Problem
    ... You have to convert your numeric value to string with ToStringfunction. ... a number into a textbox which assigns the weight value for each ... I don't want the user to have to work with decimals directly, ... I adjusted my SELECT statement using the syntax you provided for the ...
    (microsoft.public.sqlserver.fulltext)
  • SetText Method Confusion
    ... what is the correct syntax for the SetText Method? ... and neither will complile when I use them in my macro. ... before pasting the changed string to the new document. ... into the clipboard, from the clipboard into a DataObject, ...
    (microsoft.public.word.vba.beginners)