By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Problems with the Process.Start()

P: n/a
Hello World, :D

I have a problem that it is making me crazy, I hope you can help me.

I'm trying to execute a .exe file with the Procces.Start, and there
is no problem when the file is on my computer, the problem comes when
the file is in a network drive.

The most amazing thing is that in one computer I can
execute my .Net program without problems independently if the file is
in a local or in a network drive, but in others computers I have
problems when the programs execute the Process.Start().

If I pass the path in this mode:
\\hermes\hermes\temp\test.exe, I have the following problem:
The programs hangs into Process.Start() instruction.

If I pass the path in this mode: I:\ temp\test.exe, I have
the following problem: (I: is a network drive mapped to
\\hermes\hermes)
The programs enter in the catch section and throw the
exception: "The system can find the specified file"

In the computer that I have problems I execute the file from windows
making:
Start/Execute: and I write I:\ temp\test.exe and the antivir starts and
give a message saying: the publisher can't not be identified. Are you
sure you want to run this software? I say yes and then the file can
execute without problems

In the other computer I make the same:
Start/Execute: and I write I:\ temp\test.exe and I don't
have any problem the file executes without problems.

I don't know if the Antivir can be a problem, and if it is, how can
I resove? There is any parameter in the Process method to resolve this
security's problems??

Other diference between the computers is ths one of them is XP, and
the other is 2003server, my problems are in the 2003Server.
The code is the following:

public override void Handle(Context ctx)
{
try
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = ctx.getString("command");
myProcess.StartInfo.Arguments = ctx.getString("arguments");
myProcess.Start();
//We wait until the process finish.
while (myProcess.HasExited == false)
{
System.Threading.Thread.Sleep(100);
}
}
catch (Exception e)
{
Log.error(e.ToString(), e);
throw e;
}
}

Bye and thank you a lot for you attention. :D

PD: Sorry for my bad English. ;)

Apr 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.