Using Shell to Launch program from within app

February 16th, 2007 - 04:36 am ET by Mike Sims | Report spam
Hello, I tried to assign a simple command to a button

Shell ("\Windows\fexplore.exe")

It doesn't matter what I try, the execution of this code in WM5 always
returns an error saying the file does not exist. I even tried this:

If File.Exist ("\Windows\fexplore.exe") Then
msgbox "success"
Shell ("\Windows\fexplore.exe")
Else
msgbox "failure"
End If

I always receive the success msgbox, but I get a "file does not exist" when
the shell command executes.

Does anyone know how to run a program from within a WM5 application using
Visual Basic 2005 ???

Thank you,

Mike Sims
email Follow the discussionReplies 6 repliesReplies Make a reply

Similar topics

Replies

#6 Paul G. Tobey [eMVP]
February 16th, 2007 - 01:31 pm ET | Report spam
That's what the default Smart Device project types target (there should be
versions of them that say "1.0" in them, indicating that they target .NET CF
1.0, too), so it's not surprising. The code from SDF 1.4 will, of course,
still work. There just happen to be things in there that we did to fill
holes in .NET CF 1.0 that don't exist in 2.0, and, of course, there are also
new features in SDF 2.0.

Paul T.

"Mike Sims" wrote in message
news:
I am using .NET CF 2.0 according to the Remove Programs in the CE device.

"Paul G. Tobey [eMVP]" wrote:

I don't know as much about 2.0 of SDF as I do about 1.4. It's certainly
in
1.4 and you can download that in source form from:

http://www.opennetcf.org/source.ocf

It's certainly worth $50 for what's in the SDF 2.0, if you're using .NET
CF
2.0...

You'll want to figure out if you're targeting .NET CF 2.0 or not. You'd
have to install it on any target devices that you wanted your programs to
run on, if you are, so it's important information.

Paul T.

"Mike Sims" wrote in message
news:
> I'm not sure if 'my application is targeting .NET CF 2.0' or not, I'm
> fairly
> new to .net and even newer to CE development. Looks like the OpenNETCF
> stuff
> is a purchase item ... although there is a free version ... do you know
> if
> this function is in the free ver?
>
> Mike
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> P/Invoke CreateProcess(). It's wrapped in OpenNETCF's Smart Device
>> Framework (www.opennetcf.org). I believe that .NET CF 2.0 also has a
>> Process class or something of that sort which can be used to start an
>> application, if your application is targeting .NET CF 2.0.
>>
>> Paul T.
>>
>> "Mike Sims" wrote in message
>> news:
>> > Hello, I tried to assign a simple command to a button
>> >
>> > Shell ("\Windows\fexplore.exe")
>> >
>> > It doesn't matter what I try, the execution of this code in WM5
>> > always
>> > returns an error saying the file does not exist. I even tried this:
>> >
>> > If File.Exist ("\Windows\fexplore.exe") Then
>> > msgbox "success"
>> > Shell ("\Windows\fexplore.exe")
>> > Else
>> > msgbox "failure"
>> > End If
>> >
>> > I always receive the success msgbox, but I get a "file does not
>> > exist"
>> > when
>> > the shell command executes.
>> >
>> > Does anyone know how to run a program from within a WM5 application
>> > using
>> > Visual Basic 2005 ???
>> >
>> > Thank you,
>> >
>> > Mike Sims
>>
>>
>>







email Follow the discussion Replies Reply to this message
Help Create a new topic Previous pageReplies Make a reply
Search Make your own search