By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Running program in VB.NET doesn't work?

P: n/a
Hi

I am trying to run winrar from VB.NET. I do this:
Dim commando As String
commando = " E -y " + getbackupmap() + naam + " " + gettempmap()
commando = """" + getwinrar() + """" + commando
Dim p As Process = Process.Start(commando)
p.WaitForExit()

Now I get this error:
An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll
Additional information: The system cannot find the file specified

So this is the commando: C:\Program Files\winrar\WinRAR.exe" E -y
c:\Test\Backup\UParchive_20060303.zip C:\Test\temp\

When I do this in start-run it works... Am I missing something?

Thanks
Joris


Apr 5 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Joris,

Yes you miss the arguments property.

Not tested could it be something as this

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "E -y c:\Test\Backup\UParchive_20060303.zip C:\Test\temp\"
pi.WorkingDirectory = "C:\Program Files\winrar\"
pi.FileName = "WinRar.Exe"
p.StartInfo = pi
p.Start()
///

I hope this heps.

Cor
Apr 5 '06 #2

P: n/a
Hi,

I put my old code in comment and added in this code, it looks a lot better,
however, I still get the same error. I checked everything from the argument
again, but I still get this:

An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll
Additional information: The system cannot find the file specified
Greetz
Joris
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Joris,

Yes you miss the arguments property.

Not tested could it be something as this

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "E -y c:\Test\Backup\UParchive_20060303.zip C:\Test\temp\"
pi.WorkingDirectory = "C:\Program Files\winrar\"
pi.FileName = "WinRar.Exe"
p.StartInfo = pi
p.Start()
///

I hope this heps.

Cor

Apr 5 '06 #3

P: n/a
Hi,

It works now, I used this:
Dim commando As String

commando = "E -y " + getbackupmap() + naam + " " + gettempmap()

Dim p As Process = Process.Start(getwinrar(), commando)

p.WaitForExit()

Thanks for the help
"Joris De Groote" <jo************@skynet.be> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

I put my old code in comment and added in this code, it looks a lot
better, however, I still get the same error. I checked everything from the
argument again, but I still get this:

An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll
Additional information: The system cannot find the file specified
Greetz
Joris
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Joris,

Yes you miss the arguments property.

Not tested could it be something as this

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "E -y c:\Test\Backup\UParchive_20060303.zip C:\Test\temp\"
pi.WorkingDirectory = "C:\Program Files\winrar\"
pi.FileName = "WinRar.Exe"
p.StartInfo = pi
p.Start()
///

I hope this heps.

Cor


Apr 5 '06 #4

P: n/a
ja gie pipo, wistje da nie?
"Joris De Groote" <jo************@skynet.be> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,

It works now, I used this:
Dim commando As String

commando = "E -y " + getbackupmap() + naam + " " + gettempmap()

Dim p As Process = Process.Start(getwinrar(), commando)

p.WaitForExit()

Thanks for the help
"Joris De Groote" <jo************@skynet.be> wrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

I put my old code in comment and added in this code, it looks a lot
better, however, I still get the same error. I checked everything from
the argument again, but I still get this:

An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll
Additional information: The system cannot find the file specified
Greetz
Joris
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Joris,

Yes you miss the arguments property.

Not tested could it be something as this

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "E -y c:\Test\Backup\UParchive_20060303.zip
C:\Test\temp\"
pi.WorkingDirectory = "C:\Program Files\winrar\"
pi.FileName = "WinRar.Exe"
p.StartInfo = pi
p.Start()
///

I hope this heps.

Cor



Apr 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.