Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shell function and setting a directory
Message
 
To
08/04/2002 10:52:18
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00641607
Message ID:
00642212
Views:
15
I don't know about VB.Net but think that calling of API functions is still available. In that case you can specify working directory in lpDirectory parameter:
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);

>If I am in the .Net command window I can issue this command:
>>Tools.Shell """C:\apps\myexe.EXE"""
>
>The above runs the EXE but the startup directory is not set.
>
>I tried the next command but instead of changing directory, I believe that .Net looks for all DLLs etc... for this EXE.
>>Tools.Shell """C:\apps\myexe.EXE""" /dir"""C:\apps\"""
>
>I am trying to execute a VFP EXE, but I need the directory to change to the EXE directory because there are tables that the EXE needs to open on startup. However, the EXE can't find the tables unless the directory gets changed.
>
>
>
>>You can specify the default directory using ShellExecute API function.
>>
>>>Using VB.Net, how can I execute a EXE and set the directory to that EXE's path?
>>>
>>>'''This works, but the directory is not set to this EXE's path.
>>>Dim ProcID As Integer
>>>ProcID = Shell("""C:\mypath\myexe.EXE""", AppWinStyle.NormalFocus)
Previous
Reply
Map
View

Click here to load this message in the networking platform