Results 1 to 2 of 2

Thread: Starting a Program from my Program

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    91

    Question

    ok I know how to start it with appactivate but i want it to give me a message saying "please place cd in drive" if it isnt there this is the code i am using:

    'It is accessing from a cd rom

    myappid=shell (d:\setup.exe, 1)
    appactivate myappid



    I think that is all I dont have my code with me on this computer. What it does give me is a file not found and I need to debug. I am a newbie I have tried to write a if else statement but i get all kinds of errors. Read message Multiple Access/w Drive Check if you want to know what I was trying to do!! Any Help would be greatly Appreciated!!!

  2. #2
    Guest
    Try this:

    Code:
    Function DiskInDrive() As Boolean
    On Error GoTo ErrHan
      Dir "D:\", vbDirectory
      
      DiskInDrive = True
    Exit Function
    
    ErrHan:
      DiskInDrive = False
    
    End Function
    
    Usage
    
    Private Sub Command1_Click()
    If DiskInDrive() Then
      myappid = Shell("D:\setup.exe", vbNormalFocus) 
      DoEvents
      AppActivate myappid 
    Else
      MsgBox "No CD in drive!"
    End If
    End Sub

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