"Doesn't run" is useless information. It looks to me like you don't know
how to use the Format method. I don't use it much, but it seems like you'd
want to define the string once, with the {0} in it, along with the /noui,
etc. options. Something more like:
psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\" /noaskdest
/noui /delete 0", file );
Paul T.
"Gandalf" <(E-Mail Removed)> wrote in message
news:65C9E07D-151D-4F7B-BE6C-(E-Mail Removed)...
> Thanks for the information, I tried to write the following code :
> -------------------------------------------------------------------
> ProcessStartInfo psi = new ProcessStartInfo();
> psi.FileName = "wceload";
> psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\"", file +
> "
> /noaskdest /noui /delete 0");
> Process p = Process.Start(psi);
> p.WaitForExit();
> -------------------------------------------------------------------
> But that doesn't run !
> Thanks in advance for any information.
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> Put the arguments in, oddly enough, the Arguments property, after the
>> filename. Think about how you'd run it from a command line with the
>> arguments you want:
>>
>> wceload.exe "\FlashFX Disk\Kimberly\mycab.cab" /noaskdest /noui /delete 0
>>
>> or whatever. Now make the Arguments property equal that!
>>
>> Paul T.
>>
>> "Gandalf" <(E-Mail Removed)> wrote in message
>> news:90D0D724-9C7C-4B65-88B9-(E-Mail Removed)...
>> > OK, the following code runs :
>> > psi.Arguments = string.Format("\"\\FlashFX Disk\\tmp\\{0}\"", file);
>> >
>> > But how can I do to pass arguments to the "wceload" program ?
>> > For example, I want to run wceload with the following code :
>> > "wceload /noaskdest /noui /delete 0"
>> >
>> > I tried to do that but that doesn't run :
>> > ...
>> > psi.FileName = "wceload";
>> > psi.Verb = "/noaskdest /noui /delete 0";
>> > psi.Arguments = string.Format("\"\\FlashFX Disk\\Kimberly\\{0}\"",
>> > file);
>> > Process p = Process.Start(psi);
>> > ...
>> >
>> > If you see where the problem is ?
>> > Thanks in advance.
>> >
>> >
>> > "Chris Tacke [MVP]" wrote:
>> >
>> >> The space is the name is the problem. Embed quotes in the command
>> >> line.
>> >> Single quotes might work as well.
>> >>
>> >> psi.Arguments = string.Format("\"\\FlashFX Disk\\tmp\\{0}\"", file);
>> >>
>> >> or
>> >>
>> >> psi.Arguments = string.Format(@"'\FlashFX Disk\tmp\{0}'", file);
>> >>
>> >> -Chris
>> >>
>> >>
>> >>
>> >> "Gandalf" <(E-Mail Removed)> wrote in message
>> >> news:A6AE45EE-5491-4D64-848A-(E-Mail Removed)...
>> >> > Hi,
>> >> >
>> >> > I'm using the wwceload program to install automatically some cab
>> >> > files,
>> >> > but
>> >> > I have an error message which is the following :
>> >> >
>> >> > Ni .cab files to install : please specify a .cab file or double tap
>> >> > a
>> >> > .cab
>> >> > file to install the application.
>> >> >
>> >> > The code is the following (I'm using the OpenNETCF package) :
>> >> > ----------------------------------------------------
>> >> > static void runWce(string file)
>> >> > {
>> >> > ProcessStartInfo psi=new ProcessStartInfo();
>> >> > psi.FileName="wceload";
>> >> > psi.Arguments=@"\FlashFX Disk\tmp\" + file;
>> >> > Process p=Process.Start(psi);
>> >> > p.WaitForExit();
>> >> > int exitcode;
>> >> > try
>> >> > {
>> >> > exitcode=p.ExitCode;
>> >> > }
>> >> > catch
>> >> > {
>> >> > exitcode=0;
>> >> > }
>> >> > if (exitcode != 0) MessageBox.Show("Error");
>> >> > }
>> >> > ----------------------------------------------------
>> >> > However, I verified that the cab files were in the directory
>> >> > "FlashFX
>> >> > Disk\tmp" and that is ok. I don't understand why the cab files don't
>> >> > install
>> >> > themselves.
>> >> >
>> >> > Thanks in advance for any information.
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>
|