|
-
Aug 10th, 2000, 10:28 AM
#1
Thread Starter
Hyperactive Member
I want to
print "processing text file..."
and also return an integer, so a calling batch file can see if its worked or not.
I`ve seen scraps of code to open a dos box and handle input/output, but i want to write to the one the program was run from.
Any ideas?
-
Aug 10th, 2000, 12:49 PM
#2
Fanatic Member
this will run a batch command...
not sure if it helps you though
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal opOperation As String, ByVal lpFile As String, ByVal opParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
' just call it like this ShellExe("Explorer")
Public Sub ShellExe(What As String)
On Error Resume Next
Call ShellExecute(0&, vbNullString, What, vbNullString, vbNullString, vbNormalFocus)
End Sub
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Aug 10th, 2000, 03:00 PM
#3
This will write to a batch file.
Code:
Open "batch.bat" For Output As #1
Print #1, "@ECHO OFF"
Print #1, "ECHO This is a batch file example."
Print #1, "ECHO Hope this helped..."
Print #1, "ECHO If you need more...just ask!
Print #1, "ECHO I am here to help!"
Close #1
Hope that helps a little.
-
Aug 11th, 2000, 03:49 AM
#4
Thread Starter
Hyperactive Member
Thanks for replying, but neither of you provided what i`m after. I`m going to have to eliminate you...
No seriously, i dont want to run a batch command, OR create one.
What i want is to go to the dosbox and type
MyVbApp
which runs my vb app, and i want my app to be able to write to the dos box, like when you type
dir
and you get a directory listing. At the moment i could write a vb app which writes to a file, or a window, but not to the dos box.
I also want for my app to return a error value when i quit, so the next line in a batch file that invokes MyVbApp can see if it worked or not.
In c, you`d just
printf ("Hello world\n");
to print to the dos box, and
return 0;
to return a value. (from a 16 bit dos compiler anyway). I just want to do this is vb. Creating a new dos box isnt the solution. I need to run my code overnight and check the results in the morning, so i dont want interactive boxes and windows etc.
Hope this is clearer!
Thanks,
alex
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
|