473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Running program in VB.NET doesn't work?

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
4 2707
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
On a Slackware 9.1 box, I'm trying to detect if mpg123 is currently running/playing a song so that when the song is done, it'll play the next in the list. The problem is that popen'ing ps doesn't...
7
by: Marek | last post by:
Whe i'm running my .net aplication from share on other server, i've got an error. Can someone explain what i must do? Unhandle exception:System.Security.SecurityException: Permission demand type...
1
by: Sathyaish | last post by:
Scenario =========== (1) You write a program using some programming language, say, C#. (2) You make an assembly out of the program by compiling it. It is a single module assembly. (3) You...
14
by: tracernet_v2 | last post by:
fellow c# programmers... i need some help.... i have created a program, a module that is part of another bigger program... when i debug it, by pressing F5 in the IDE, it runs so well i can...
13
by: John Salerno | last post by:
If I want to write my code in a separate text editor (I like UltraEdit) but then press a single button to have that code run in the IDLE environment, is that possible? I know that you can configure...
12
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
14
by: Alex K. | last post by:
Hi all I'd like to avoid starting the same c# application twice on the same computer. How do I check if it is already running? Thank you
2
by: upperclass | last post by:
Hi, I'm trying to find a decent way to measure program running time. I know clock() is probably the standard way of doing it but clock_t overflows too quickly. The target program running time...
5
by: david | last post by:
I'm developing a program that runs using an asyncore loop. Right now I can adequately terminate it using Control-C, but as things get refined I need a better way to stop it. I've developed...
9
by: Jimmy | last post by:
Well, i know it may be a little non-python thing, however, I can think of no place better to post this question :) can anyone tell me, in python, how to obtain some information of a running...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.