0

I have question about shell command

well lets say i have this

Shell("\bin\game.exe", AppWinStyle.NormalNoFocus)

Well as you know the command will come up an say File Not Found

FileNotFoundException

So how can i put this command and when the file is not found turn up with this method

MessageBox.Show("File not found.Please place the program into the program folder")'

Without showing the filenotfound exception

Hope you understand

MarkGia

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by MarkGia
0

Well masters i dont think it is difficult to tell me that it is a two minutes answer

0

Using the Try - Catch method.

Try 
Shell("\bin\game.exe", AppWinStyle.NormalNoFocus) 
catch ex as Exception 
if ex.message = "" 'Can't remember the exact text, type in the exact exception message
then MessageBox.Show("File not found.Please place the program into the program folder")
else 
msgbox (ex.message) 
end if
end try

Edited by adam_k: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.