|
-
Jun 25th, 2000, 08:16 PM
#1
I am trying to use the shell function to execute a program from my code and I am getting the error file not found, but if I copy the path to the run dialog box it executes the EXE fine. I cannot figure out why this is happening. If anyone can help I would really appreciate it.
Thanks in advance
-
Jun 25th, 2000, 08:24 PM
#2
_______
syntax...maybe...
here's an example..let's see your code and your path
Dim RetVal
RetVal = Shell("C:\WINDOWS\notepad.exe C:\WINDOWS\mytext.txt", 1)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 25th, 2000, 08:27 PM
#3
My Code
This is what my code does:
Code:
shell "C:\Program Files\3dfx\VisualReality\TV\3dTv.exe"
it doesnt work, but I copied it from the shortcut and if I pasted it into the run dialog it executes.
Code:
shell "c:\program files\Microsoft Office\office\winword.exe"
works fine.
I am completely puzzled????
-
Jun 25th, 2000, 10:09 PM
#4
_______
..so am I...
Shell "C:\Program Files\Birthday Reporter\birthdays.exe"
this runs my exe from within program files..
check your path...ie..go to your exe through
windows explorer..find your exe and right click to
get it's path and then copy it into your shell
statement...add the pgm.exe to it and it should work.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 26th, 2000, 02:08 AM
#5
PowerPoster
ShellExecute API
Juz use the ShellExecute API is much more better then the ordinally Shell f unction.
Code:
Option Explicit
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 Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, <Your FileName Here>, vbNullString, "C:\", SW_SHOWNORMAL
End Sub
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
|