|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Running program in VB.NET doesn't work?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 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 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 Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:eROY3GKWGHA.1220@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 > 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 Show quoteHide quote "Joris De Groote" <joris.degro***@skynet.be> wrote in message news:%23TSNdZKWGHA.4292@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]" <notmyfirstn***@planet.nl> wrote in message > news:eROY3GKWGHA.1220@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 >> > > ja gie pipo, wistje da nie?
Show quoteHide quote "Joris De Groote" <joris.degro***@skynet.be> wrote in message news:%23zPyftKWGHA.4148@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" <joris.degro***@skynet.be> wrote in message > news:%23TSNdZKWGHA.4292@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]" <notmyfirstn***@planet.nl> wrote in message >> news:eROY3GKWGHA.1220@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 >>> >> >> > >
Seemingly random Concurrency violations updating Access database
Insert into database How to invoke the ClassLibrary? Read sequential file using VB Query based on a text box value.. One line of code not working : susposed to resize datagrid column.. MDI Child Controls question Host application in IE New : test yourself my new VB6 syntax analyzer. Re: .Net and Windows 98 |
|||||||||||||||||||||||