|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
I am trying to launch a separate executable in a controlled development environment using the Shell Function from a VB 6.0 application located in a different directory.
For discussion's sake, let me define a few items: My VB application = MyVB.exe My Target app = Target.exe root | |_VBDir |___MyVB.exe | |_TargetDir |___Target.exe Because this is a controlled dev environment, I cannot simply move MyVB.exe into the TargetDir; it must reside in a separate directory. Normally, Shell works fine. However, this particular case, my Target.exe has relative links in it. When I run my app from my VBDir, all of the Target.exe's relative links are wrong and Target.exe barfs. Does anyone know how to launch another executable from within a VB app where the "Start in" directory is correctly set to the Target.exe's? Many thanks, Steve |
|
#2
|
||||
|
||||
|
What is the exact command that you are using to execute the command with Shell()?
|
|
#3
|
||||
|
||||
|
Here's the code. I've changed the exe & dir names to match my example above, but this is otherwise identical to what I run:
Dim RetVal Dim MyPath MyPath = "C:\TargetDir\Target.exe" RetVal = Shell(MyPath, vbNormalFocus) |
|
#4
|
||||
|
||||
|
I think what you are looking for is SetCurrentDirectory
Public Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Launching another exe from a different directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|