%1 is not a valid Win32 application in Process.Start()

K

kk

hello all,

I want to call an exe(IISWeb.vbs) to create a site in Sharepoint.While
calling that exe through Process.Start() it throws the following
exception.

1.while calling through webService ,it throws the exception "ACCESS
DENIED".

2.While calling through console Application,it throws

"%1 is not a valid Win32 application"

The code i used for that is

ExecuteExeFile(string exeFilePath, string arguments)
{
try
{
Process ps = new Process();
ps.StartInfo.FileName = exeFilePath;
ps.StartInfo.UseShellExecute = false;
ps.StartInfo.Arguments = arguments;
ps.StartInfo.CreateNoWindow = true;
ps.StartInfo.RedirectStandardInput = true;

ps.StartInfo.RedirectStandardOutput = true;
ps.Start();
StreamReader MyStreamReader = ps.StandardOutput;
retStr = MyStreamReader.ReadToEnd();
ps.WaitForExit();
}
catch (Exception e)
{
retStr = "Error";
WriteLog("ExecuteExe :"+e.Message);
}
}

Is there any mistakes in this...
Any solutions............

thanks in advance

KARTHICK.K
Mail :: (e-mail address removed)
 
G

Guest

try to delete the line where you set it the arguments... and then run it....
i dont know, but %1 is an argument, and doest like it...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top