CHAMAR EXECUTAVEL DE UM CD
Amigos, boa noite...
Alguém se lembra da rotina de chamar um executável de dentro de um cd no cdrom ???
Sei que é fácil, mas não me lembro do procedimento, vasculhei aqui no forum e não encontrei.
Abraços!!!
Alguém se lembra da rotina de chamar um executável de dentro de um cd no cdrom ???
Sei que é fácil, mas não me lembro do procedimento, vasculhei aqui no forum e não encontrei.
Abraços!!!
Amigos, essa parte eu ja consegui lembrar e ficou assim:
Call Shell([Ô]F:\mysql-4.0.16-win\setup.exe[Ô])
Agora gostaria que me ajudassem como capturar a letra do cd rom do cliente, pois pode existir partições no hd e a letra poderá variar, alguém tem alguma ideia???
Call Shell([Ô]F:\mysql-4.0.16-win\setup.exe[Ô])
Agora gostaria que me ajudassem como capturar a letra do cd rom do cliente, pois pode existir partições no hd e a letra poderá variar, alguém tem alguma ideia???
é necessário referencia a dll SCRRUN.DLL que esta pasta system32
If FileExists([Ô]A:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]A:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]B:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]B:\mysql-4.0.16-win\setup.exe[Ô])
End If
Public Function FileExists(sFullPath As String) As Boolean
Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function
JWCELYO, MUITO BOM, FUNCIONOU MAS TIVE QUE COLOCAR TODAS AS LETRAS POSSIVEIS PARA NÃO HAVER ERROS, FICANDO ASSIM:
If FileExists([Ô]A:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]A:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]B:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]B:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]C:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]C:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]D:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]D:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]E:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]E:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]F:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]F:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]G:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]G:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]H:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]H:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]I:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]I:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]J:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]J:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]K:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]K:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]L:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]L:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]M:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]M:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]N:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]N:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]O:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]O:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]P:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]P:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]Q:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Q:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]R:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]R:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]S:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]S:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]T:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]T:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]U:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]U:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]V:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]V:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]X:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]X:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]Z:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Z:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]W:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]W:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]Y:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Y:\mysql-4.0.16-win\setup.exe[Ô])
End If
E QUANDO REFERENCIEI A DLL SCRRUN.DLL DEU ERRO COM UMA MENSAGEM DIZENDO QUE ELA JA ESTAVA EM USO, FUNCIONANDO MESMO ASSIM, ESPERO QUE NÃO DE BODE!!!
OBRIGADO PELA AJUDA, ABRAÇOS!
If FileExists([Ô]A:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]A:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]B:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]B:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]C:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]C:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]D:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]D:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]E:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]E:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]F:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]F:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]G:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]G:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]H:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]H:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]I:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]I:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]J:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]J:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]K:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]K:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]L:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]L:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]M:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]M:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]N:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]N:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]O:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]O:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]P:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]P:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]Q:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Q:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]R:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]R:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]S:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]S:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]T:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]T:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]U:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]U:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]V:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]V:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]X:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]X:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]Z:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Z:\mysql-4.0.16-win\setup.exe[Ô])
End If
If FileExists([Ô]W:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]W:\mysql-4.0.16-win\setup.exe[Ô])
ElseIf FileExists([Ô]Y:\mysql-4.0.16-win\setup.exe[Ô]) = True Then
Call Shell([Ô]Y:\mysql-4.0.16-win\setup.exe[Ô])
End If
E QUANDO REFERENCIEI A DLL SCRRUN.DLL DEU ERRO COM UMA MENSAGEM DIZENDO QUE ELA JA ESTAVA EM USO, FUNCIONANDO MESMO ASSIM, ESPERO QUE NÃO DE BODE!!!
OBRIGADO PELA AJUDA, ABRAÇOS!
Tópico encerrado , respostas não são mais permitidas