|
-
Aug 24th, 2000, 04:26 AM
#1
Thread Starter
New Member
Has anyone had problems when shelling out to a command prompt, the prompt just won't appear?! If you re-boot and re-run at that point it works!
Second time round it then got half way through the BCP batch file it was running and then hung with the same results then as before, not being able to open a command prompt. There was plenty of memory left and the batch file itself works!
Has anyone got any ideas???!
-
Aug 24th, 2000, 09:02 AM
#2
Member
Solution
Have you tried using the API Call ShellExecute,
create a form (called frmMain) and a textbox(txtFilePath) and commandbutton(cmdRun). Then paste the code below into the form code.
Enter the path of the file you want to run and click the commandbutton. This will run the file with its associated program. (command.com or cmd.exe)
To run a file use the following code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub cmdRun_Click()
Dim ReturnVal as Long
ReturnVal = ShellExecute(frmMain.Hwnd, "open", txtFilePath.Text, "", "", 1)
End Sub
Grant French
-----------------------------------------------
E-Mail: [email protected]
ICQ: 33122184
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|