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 :)

Recommended Answers

All 3 Replies

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
commented: this helped me in my project !! +1

thx a lot its work Great :)

thanks this helped me too !!

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.