Hi William,
Are you sure that the TypeIt.exe file is in the default path? Have
you tried displaying the actual "filnam" variable that's being passed
in? Put a temporary editfield and statictext on your window and use
it to display the filnam contents and the sh results. Also, you
should check the sh.Errorcode. Give this a try:
Dim sh As New Shell
Dim filnam As String
StaticText1.Text = filnam
sh.Execute "TypeIt.exe " + Chr(34) + filname + Chr(34)
If sh.Errorcode <> 0 Then
Editfield1.Text = sh.Result
// Handle an error situation from the shell
Else
// Handle the successful completion
End If
HTH,
Tim
--
Tim Jones [EMAIL PROTECTED]
On Oct 17, 2006, at 2:14 PM, William Squires wrote:
Okay, problem here. I'm trying to execute a file (.EXE) from my RB
program. I've tried:
...
Dim sh As Shell
Dim filnam As String
// Setup filnam
...
// Make Typeit.exe work with the file named in 'filnam'
sh = New Shell()
sh.Mode = 0
sh.Execute "Typeit " + filnam
...
where 'Typeit' is the name of the executable I'm trying to run, and
'filnam' (DIMmed as String) holds the name of the file I want
Typeit to operate on.
I've already verified that Typeit works as desired from the
Windows' "DOS Window" (command shell), when the named file is in
the same directory as Typeit.exe and my RB program.
Unfortunately, sh.Execute doesn't seem to do anything.
Originally, (as a test), I did:
sh.Execute "TYPE " + filnam + " > LPT1"
but it didn't do anything either, except that the results of the
"TYPE" command appeared in the 'results' buffer of the shell object
(as confirmed in the debugger.)
Using RB 5.2.4 Win on WinXP. Unfortunately, the company I work
for won't approve an update to RB2006 (Win) unless I can guarantee
that the shell problem has been fixed (and no other part of the
program breaks). Otherwise, I gotta fork over the cash for it. Ouch.
Side note: when I was typing in the code, the info window popped
up a message saying that "Execute" was part of an RB plugin in C:
\Documents and Settings\Administrator\Application Settings
\RBShell500.dll, so I figured maybe I could make a declare to it,
but how do I find out what the function prototype is?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>