ASP .NET wont allow me to add arguments to an application

Here is the code. It will open the cmd.exe on the server and keep the window open. It does not use the arguments. I want it to net send a computer, but it doesnt. I cannot add the net send into the filename...because net.exe is the filename but not all the extra stuff after it. Can someone please help me on how to execute an exe and put arguments on the end of it. thx (plz DO NOT give me VB 6 or .NET code...I am using the ASP.NET webpage code...and the VB6 code does not work, i have tried)



Dim myProcess As New System.Diagnostics.Process()
        myProcess.StartInfo.FileName = "cmd.exe"
        myProcess.StartInfo.Arguments = "net send computer test"
        myProcess.StartInfo.UseShellExecute = True
        myProcess.Start()
        myProcess.Close()
LVL 2
atkfrg56Asked:
Who is Participating?
 
amit_gConnect With a Mentor Commented:
Give this a try ...

Dim myProcess As New System.Diagnostics.Process()
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.Arguments = "/c net send computer test"
myProcess.StartInfo.UseShellExecute = True
myProcess.Start()
myProcess.Close()

Please note the /c in Arguments.
0
 
maXXXeECommented:
why dont u make a ".bat" file and execute it from ur application.
0
 
atkfrg56Author Commented:
I dont want to do a .bat in this case, because the next step is to upgrade from "net send"  use "dsadd.exe contact blah....." and the 'blah' will be filled in via the webpage. To use a .bat I would have to write one via .asp on the fly... and then execute it, then delete the .bat since i wont need it anymore.

I have .bat for my other application because its static data.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
atkfrg56Author Commented:
If this can be answered, you will also get an A on http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21375733.html so that you get 1000 points.
0
 
atkfrg56Author Commented:
amit_g,
thank you so much, it works
0
 
amit_gCommented:
Glad to be of help.

Please ask other question to be deleted. It is against EE policy to award more than 500 points.
0
 
atkfrg56Author Commented:
Ok, I will delete it.  I wish they had a 1000 point category though because this means so much more to me than 500.
Thanks
0
 
mark_landCommented:
i get this error message, the system cannot find the file specified

 Dim myProcess As New System.Diagnostics.Process
            myProcess.StartInfo.FileName = "cmd.exe"
            myProcess.StartInfo.Arguments = "/c net send computer test"
            myProcess.StartInfo.UseShellExecute = True
            myProcess.Start()

0
 
amit_gCommented:
mark_land, it is better to ask a new question.

Do you have Windows 98? Try Command.exe instead of cmd.exe.
0
All Courses

From novice to tech pro — start learning today.