Public Class ProcessFile Public cFileName As String = "" Public cWorkingDirectory As String = "" Public cArguments As String = "" Public oProcess As Process = New Process Public cResponse As String = "" Public Function Process() As String ' If we have a working directory If cWorkingDirectory.Length > 0 Then If Framework.FileFunction.DirectoryExist(cWorkingDirectory) = False Then App.cError = "The directory " + cWorkingDirectory + " does not exist." Return False End If End If If Framework.FileFunction.FileExist(cFileName) = False Then App.cError = "The file " + cFileName + " cannot be empty." Return False End If oProcess.StartInfo.FileName = cFileName oProcess.StartInfo.WorkingDirectory = cWorkingDirectory oProcess.StartInfo.Arguments = cArguments oProcess.StartInfo.RedirectStandardOutput = True oProcess.StartInfo.RedirectStandardInput = True oProcess.StartInfo.UseShellExecute = False oProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized oProcess.StartInfo.CreateNoWindow = True Try oProcess.Start() Catch ex As Exception App.cError = ex.Message Return False End Try cResponse = oProcess.StandardOutput.ReadToEnd() Return True End Function End Class