Solved

C# code to start a program

Posted on 2011-09-19
7
326 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
  • 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now