Link to home
Start Free TrialLog in
Avatar of Ken H.
Ken H.

asked on

Execute .exe and pass variables from vb.net webpage button click event

I have an .exe file that decrypts some .dat files. From a button click event I need to call this exe and pass the following variable string to it:

C:\inetpub\wwwroot\bin\sddebug.exe -i <txtPath.text & "\SnapDriveInfo\*.dat"> -o <txtPath.text & "\SnapDriveInfo\">

Can someone help me with this?
ASKER CERTIFIED SOLUTION
Avatar of nishant joshi
nishant joshi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ken H.
Ken H.

ASKER

Thanks. You put me on the right path. I ended up with this:

  Dim filepath As String = txtPath.Text & "\SnapDriveInfo\"
            Dim dbgFiles As String() = IO.Directory.GetFiles(filepath)
            Dim datFiles = From p In dbgFiles Where p.Contains(".dat") Select p

            For Each File In datFiles
                Dim sourceFile As String = File
                Dim fileName As String = IO.Path.GetFileName(sourceFile)
                Dim destFile As String = fileName.Replace(".dat", ".log")
                Dim p As New ProcessStartInfo
                p.FileName = "D:\sddbglog.exe"
                p.Arguments = " -i " & sourceFile & " -o " & txtPath.Text & "\SnapDriveInfo\Debug\" & destFile
                Process.Start(p)
            Next

Open in new window