Solved

C# code to start a program

Posted on 2011-09-19
7
332 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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
parsing question on dynamic concatenation 3 39
Need help with another query 10 52
What!!!??? 5 59
C#:  Need to switch between timer loop and token driven loop 2 30
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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