Duall

how to use Shell function in wm5

i've tried:

Shell("myfile.exe", AppWinStyle.Hide)

but the error was file not found.. i've also tried entering complete path to the file. but same error



Re: Smart Devices VB and C# Projects simple shell

Ilya Tumanov

Legacy VB Shell() function does not work on devices. Use Process class instead.






Re: Smart Devices VB and C# Projects simple shell

Duall

i've tried this:

Dim psi As New ProcessStartInfo()

psi.FileName = "myfile.exe"

psi.Arguments = "blabalblablabla"

Process.Start(psi)

the error is : Win32Exception was unhandled

what i did wrong





Re: Smart Devices VB and C# Projects simple shell

Ilya Tumanov

Whatever's in the error message and/or error code in that exception. Probably you did not specify full path to the exe.






Re: Smart Devices VB and C# Projects simple shell

Christopher Fairbairn

Hi,

Duall wrote:
Dim psi As New ProcessStartInfo()

psi.FileName = "myfile.exe"

psi.Arguments = "blabalblablabla"

Process.Start(psi)

the error is : Win32Exception was unhandled

what i did wrong

Unlike on the desktop the Windows Mobile (Windows CE) environment does not have the concept of a current working directory. So the operating system will not look in the current folder for executables you attempt to launch etc.

All filenames (with a few minor exceptions) must be full paths starting at the root of the file system. The root of the Windows CE filesystem is called \, which is basically the equivalent of c:\ on a desktop PC.

So if your application is installed into the \Program Files\MyProgram folder you may have more luck if you specify "\Program Files\MyProgram\myfile.exe" as your filename in the above call.

Hope this helps,

Christopher Fairbairn