Results 1 to 3 of 3

Thread: Open a *.lnk file in VB6.0

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    2

    Post Open a *.lnk file in VB6.0

    Hi,

    I am trying to mae a simple VB application that does not allow people to access the Internet before 8:30. What I want to be able to do is, if it is after 8:30, bring up the Dial-Up to the ISP box, and if it is not after 8:30, show a message box. So far I have been going ok, but I cant get VB to open up a LNK file to get the DUN box to disply. The code I have made is below.

    Private Sub Command1_Click()
    If Label1.Caption < "8:30" Then
    MsgBox "You May Not Use The Internet Before 8:30PM"
    Else
    Shell "C:\WINDOWS\Application Data\Microsoft\Internet Explorer\Quick Launch\Telstra.lnk"
    End If

    The error I get is
    Run-time error '53':

    File Not Found

    The file is there and I do not know what to do now.
    Any help would be great.

    Thanks.

    Inosmnia

  2. #2
    Addicted Member OsirisX's Avatar
    Join Date
    May 2002
    Location
    Montgomery, AL
    Posts
    132

    Run DLL, Run!

    If you want to launch a DUN session there is a better way than shelling a LNK. Do it directly.

    ...by "Dave O'Connell" <Doconnell@H...> on Fri, 27 Jul 2001
    "...The following code will allow you to connect to a predefined Dial-Up
    Networking entry.

    DialUPNetwork:
    Dim res As Double
    res = Shell("rundll32.exe rnaui.dll,RnaDial " & "Dial-Up Net entry", 1)

    The Shell command will bring up the Connection screen that you should be
    familar with. The AppActivate and SendKeys commands allow you to
    automatically click on the "Connect" button. ..."

    or put in text if you don't have it set to auto-dial.
    --OsirisX
    AIM, Yahoo: OsirisX11
    ICQ: 56697525
    MSN: [email protected]

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    2

    Thanks.

    Thanks for your help guys. I couldn't get your solution to work mendhak, but I could use yours and get it working fine OsirisX.

    Thanks

    Insomnia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width