views:

58

answers:

1

I am getting the following error when invooking the follwoing code.

  if (Directory.Exists(Destination))
  {
     Ent.Installer.Tasks.ShellOperations.ShellCommand sc = 
         new Ent.Installer.Tasks.ShellOperations.ShellCommand(
             "mklink", "/D \"" + Source + "\" \"" + Destination + "\"");
     result = (bool)sc.Execute();  
}

When the above is executed it intunr invokes the following code.

Process p = new Process();
pInfo = new ProcessStartInfo();
pInfo.CreateNoWindow = true;
pInfo.WindowStyle = ProcessWindowStyle.Hidden;
pInfo.ErrorDialog = false;
pInfo.UseShellExecute = false;
pInfo.FileName = this.Command;
pInfo.Arguments = this.Args;
if (this.WorkingDirectory.Length > 0)
{
    pInfo.WorkingDirectory = this.WorkingDirectory;
}
pInfo.RedirectStandardOutput = true;            
p.StartInfo = pInfo;            
p.Start();

when p.Start is invoked i am getting the error "The system cannot find the file specified"

any pointers are greatly appreciated.

A: 

Start a debugger, use a debugger to evaluate your ShellCommand option, copy and paste into a command shell. This should give a hint of what is going wrong.

Adrian Grigore