Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Execute a command line in VS2012

Posted on 2013-06-13
2
Medium Priority
?
397 Views
Last Modified: 2013-07-05
Greeting,

I have the following command in bat and I would like to know how to execute the same command in Visual Studio app.

cd %ProgramFiles(X86)%\xxxxxxxxx\bin
zac unr -u MyUserName -p MyPassword
pause
exit
0
Comment
Question by:mrong
[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
2 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 2000 total points
ID: 39246254
using( Process process = new Process() )
{
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.UseShellExecute = false;
    startInfo.RedirectStandardError = true;
    startInfo.FileName = "C:\\Program Files (x86)\\bin\\zac";
    startInfo.Arguments = "-u MyUserName -p MyPassword";

    process.EnableRaisingEvents = false;
    process.StartInfo = startInfo;

    process.Start();
}

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39247140
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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