Hii Friends
I have written a vb code in which i can call an external application using shell command
"Shell("C:\\abc.exe")" Now when i call this command it avtually executes this command.
But what i want is some command where i dont want to run the file but make sure that the file can run..i know the only way to make sure is by double clicking the file or by using the shell command..But i dont want to do that.Just make sure that the file will run
Is it possible????

There is really no sure way to programmatically determine whether or not another program can be run.
The only way to really it is to actually try to execute the file.
On that front, you can use the Shell commands FileNotFound exception error in order to determine if the file can be executed or not.
Like so:

Try
   Shell("""abc.exe"")
Catch fx As System.IO.FileNotFoundException
   'Something went wrong with the execution of the file.
   'Either it's a 16-bit command trying to be run on a 32-bit system,
   'or the file cannot be found
Catch ex As System.Exception
   'Catch any other Exceptions here
End Try
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.