944,058 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 35700
  • C# RSS
Jul 7th, 2005
0

C# Command Line Application

Expand Post »
Hi, I've made a web application, and now I want to be able to distribute it with a copy of MSDE SP4. MSDE has to be installed via command line, and the web application takes a certain database setup. I've got all the scripts and commands ready to install the new copy of MSDE, create the database, tables and the stored procedures. I want to make it automated so anyone can install this setup, but i have no idea where to begin.

I've been playing around with System.Diagnostics.Process class and I can open the command line, but i have no idea how to place commands in it. I really don't know where to go from there. Am i even on the right track?

Any point in the right direction would be greatly appreciated.

drp
Similar Threads
drp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
drp is offline Offline
4 posts
since Jul 2005
Jul 7th, 2005
0

Re: C# Command Line Application

UPDATE:

Ok I've got the command to run the Setup.exe file. It installs MSDE fine --> now I have to (without restarting the computer) start the MSDE service. Here's what I have:

System.Diagnostics.Process Process3;
Process3 = new System.Diagnostics.Process();

cmd = "C:\\WINDOWS\\system32\\Net.exe";

Process3 = System.Diagnostics.Process.Start(cmd, "NET START \"SQLAgent$NETSDK\"");

Process3.WaitForExit();
Process3.Close();

when this part of the code runs it quickly starts the net.exe --> then closes
Ive been able to capture part of it with print screen and it says:
"The syntax of this command is:

NET:"

I know the syntax is: NET START "SQLAgent$NETSDK"

Ive printed out my string variable that holds the parameter and it comes out just like its supposed to.

Has anyone ever encountered this? Or does anyone have an idea of what might be going wrong?

Thanks for your time.
drp
drp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
drp is offline Offline
4 posts
since Jul 2005
Jul 7th, 2005
0

Re: C# Command Line Application

ok -- nevermind i guess. Apparently since I was opening the Net.exe the command doesnt need the "NET START" it just needs "START".....hmmm?
drp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
drp is offline Offline
4 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Help....C# Project
Next Thread in C# Forum Timeline: copying file/folder to a net drive





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC