Results 1 to 3 of 3

Thread: Run checking and menu-using :)

  1. #1

    Thread Starter
    Member Cahlel's Avatar
    Join Date
    Aug 2000
    Location
    Earth (I think)
    Posts
    63

    Cool

    Well, using a menu, I coded a ru nprogram into it with hopes that
    'everything would be alright'
    but it wasn't....

    is there a check or 'ifexists blahblah' command that I could use to check this code:

    progr = inputbox("What would you like to run?")
    shell = progr, vbnormalfocus

    now, is there a SIMPLE way to check so that if the command does not excist, it will not run it or give you an error message or start explorer in that directory? Please help me, oh and we need a chat room, Hey how do you get to 'fanatic' or 'guru' status?
    Wisdom is supreme, therefore get wisdom,
    though it costs all you have, get understanding.
    Proverbs 4:7

  2. #2
    Guest
    Use the Dir() function.

    Code:
    Resp = InputBox("Enter a File to open")
    'Check if file exsists
    Retval = Dir(Resp)
    If Retval <> "" Then
        'It does exsist so run it
        Shell Resp, vbNormalFocus
    Else
        'It does not exsist
        MsgBox ("It does not exsist")
    End If

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Fanatic Member status comes from posting a lot. Guru status is voted on you, if you have made many posts of a consistently high standard. Megatron here is a good example
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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