Shell(pathName,WinAppStyle) :: VB vs VB.Net

iota

New member
Joined
Jan 22, 2006
Messages
3
Programming Experience
Beginner
Why is this code incorrect in VB while correct in .Net ?

VB.NET:
Shell("cmd" ,vbNormalFocus )

How can I make correctness in VB ?
Thank you so.
 
I'm not sure what you mean by "Correctness", but Shell is a windows API call to Shell and should basically work the same in .net as in VB6.

Here is how to shell in .net not using the API. Read up on all of the options for the Process class...

Imports System.Diagnostics



Public Shared Sub ShellApp(ByVal inAppName AsString, ByVal inArguments AsString)
Try
Dim myProcess AsNew Process
myProcess.Start(inAppName, inArguments)
Catch ex As Exception
RaiseEvent GeneralLibraryException("Exception Raised in
IDOGeneral::ShellApp()", ex)
EndTry
EndSub

Disregard the RaiseEvent you can just do a messagebox call here.

Hope this helps!
 
Back
Top