?
Solved

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

Posted on 2005-04-04
9
Medium Priority
?
251 Views
Last Modified: 2008-04-09
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()
0
Comment
Question by:atkfrg56
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 7

Expert Comment

by:maXXXeE
ID: 13698600
why dont u make a ".bat" file and execute it from ur application.
0
 
LVL 2

Author Comment

by:atkfrg56
ID: 13698798
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
 
LVL 2

Author Comment

by:atkfrg56
ID: 13699416
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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
LVL 58

Accepted Solution

by:
amit_g earned 2000 total points
ID: 13700424
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
 
LVL 2

Author Comment

by:atkfrg56
ID: 13700652
amit_g,
thank you so much, it works
0
 
LVL 58

Expert Comment

by:amit_g
ID: 13700703
Glad to be of help.

Please ask other question to be deleted. It is against EE policy to award more than 500 points.
0
 
LVL 2

Author Comment

by:atkfrg56
ID: 13700806
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
 

Expert Comment

by:mark_land
ID: 14768664
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
 
LVL 58

Expert Comment

by:amit_g
ID: 14768673
mark_land, it is better to ask a new question.

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

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question