I need to execute an exe from vb application which requires that a
particular directory should be current
so before I execute this exe I need to make sure that current directory is a
particular one....
how can I do this ?
[Batch file is not an option neither modifying the called exe to change the
directory from exe itself]
Please help ?
Regards
Pankaj
Perhaps the ShellExecute API function, which allows you to pass a working
(or start in) directory. If that doesn't work, I think you'll have to ChDir
to the directory before executing the program.
Mike
> Hi All
>
> I need to execute an exe from vb application which requires that a
> particular directory should be current
> so before I execute this exe I need to make sure that current directory is a
> particular one....
>
> how can I do this ?
Dim MyFolder As String
Dim CurrentFolder As String
MyFolder = "whatever"
CurrentFolder = CurDir$()
ChDrive MyFolder
ChDir MyFolder
Shell...
ChDrive CurrentFolder
ChDir CurrentFolder
If MyFolder is on the same drive as CurrentFolder (e.g., both on C:)
then you don't need the ChDrive calls.
Gale.