Shell Function "file not found" error
I want to open some files using my program. and I decided to use a shell command. but when i use shell it gives "file not found error"
for example
Shell("C:\Documents and Settings\ÖnerYavuz\Desktop\aa.txt") ==> it gives error
but
Shell("C:\Documents and Settings\ÖnerYavuz\Desktop\warkey.exe")==> its work
and i thought it opens only exes. but :?:
Shell("C:\Documents and Settings\ÖnerYavuz\Desktop\euroloader") ==> Unfortunately, this also has failed
umm. again :D i thought mybe i forget ".exe"
Shell("C:\Documents and Settings\ÖnerYavuz\Desktop\euroloader.exe")==> failed again...
also it wont open access or powerpoint files.
im really confused. Please Help ME :'(
thx for replys :)
Oneryavuz
Junior Poster in Training
56 posts since Jul 2011
Reputation Points: 10
Solved Threads: 3
See if this helps.
Private Sub loadFile(ByVal myCoolSelectedFile As String)
If IO.File.Exists(myCoolSelectedFile) Then
Process.Start(myCoolSelectedFile)
Else
MsgBox("This file does not exist.")
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
loadFile("C:\someFile.someExtension")
End Sub
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
thx a lot its work Great :)
Oneryavuz
Junior Poster in Training
56 posts since Jul 2011
Reputation Points: 10
Solved Threads: 3