?
Solved

C# code to start a program

Posted on 2011-09-19
7
Medium Priority
?
335 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 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