Solved

C# code to start a program

Posted on 2011-09-19
7
331 Views
Last Modified: 2013-12-17
I have a program that I am making in C#. Part of the program needs to check if a process is running and, if it is not, start it. I got it to work fine with the process that it needs to start is on the local machine, but it needs to start the process from a network drive and that is not working. Here is what I have right now for it to start the program:

Process.Start(@"\\Cmn-It-maakes\C$\Testing\NOTEPAD.EXE");

That crashes out with the error: No network provider accepted the given network path

What do I need to do?

Thanks
0
Comment
Question by:wiggy353
[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
  • 4
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
jason987 earned 500 total points
ID: 36561507
'c$' is the administrative share.  Try creating a regular share and/or mapping.
0
 
LVL 1

Author Comment

by:wiggy353
ID: 36561546
I can't that is the share that I am told it has to be in. Is there a way to make it work using that share?
0
 
LVL 5

Expert Comment

by:jason987
ID: 36561763
Can't you map the share first using the proper credentials?  

net use SERVERNAME\IPC$ /user:USERNAME PASSWORD
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 1

Author Comment

by:wiggy353
ID: 36561822
It would make sense to do that, wouldn't it? Unfortunately, I cannot convince the users of that computer to do so. Can I write the code to include login information like with netinfo or something?
0
 
LVL 1

Author Comment

by:wiggy353
ID: 36562052
From what I am finding, I can use the StartInfo.username and startinfo.password to do this, but I can't figure out the correct syntax...
0
 
LVL 5

Expert Comment

by:jason987
ID: 36562453
Those are who you are going to be running the process as not the network credentials.
0
 
LVL 1

Author Comment

by:wiggy353
ID: 36562485
I think I convinced them to just map the drive.
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

763 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