We help IT Professionals succeed at work.
Get Started

VB.Net execute commandline with process.start

3,108 Views
Last Modified: 2013-11-07
Hi experts,

I can't get this to create the dump file. Even though it works when i paste it in directly from a command prompt.

Essentially, it is a VB.NET winform that executes cmd.exe with arguments which creates a txt output file.
       


       Dim ProcessProperties As New ProcessStartInfo

       ProcessProperties.FileName = "cmd.exe"
        ProcessProperties.Arguments = "/C " & Chr(34) & NetworkSharePath _
            & "code" & Chr(34) & " " & ermCode & " " & Chr(34) & NetworkSharePath & "\" & org & "\" & Year & "\" & Year & "-" & Month & "\val_" & org & ".txt" & Chr(34) & " " & Chr(34) & NetworkSharePath & "\" _
            & org & "\" & Year & "\" & Year & "-" & Month & "\map_" & org & ".txt" & Chr(34) & " " & Chr(34) & File_Sample & Chr(34) & " >> " & Chr(34) & File_CreatedKey & Chr(34)

        ' start the process in a hidden window
        ProcessProperties.WindowStyle = ProcessWindowStyle.Hidden
        ProcessProperties.CreateNoWindow = True
        ProcessProperties.UseShellExecute = False
        Process.Start(ProcessProperties)


NOTE: The giant string for args works fine when i open CMD.exe and past it in to test.

What am i doing wrong here?
Hades666
Comment
Watch Question
DevOps Manager
Top Expert 2011
Commented:
This problem has been solved!
Unlock 3 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE