|
-
Sep 2nd, 2006, 10:10 AM
#1
Thread Starter
Addicted Member
How to run a bat file in vb
ok i want to run a bat file in vb? but how?
-
Sep 2nd, 2006, 10:11 AM
#2
Re: How to run a bat file in vb
Just Shell it:
Shell "c:\mybatchfile.bat"
-
Sep 2nd, 2006, 10:12 AM
#3
Thread Starter
Addicted Member
Re: How to run a bat file in vb
humm... i mean like i have a window that is like commad prompt so i can see it running
-
Sep 2nd, 2006, 10:15 AM
#4
Re: How to run a bat file in vb
Hmmm... That's all you really need - if you would just try typing you'd see a bunch of consts:
Shell "c:\mybatchfile.bat", vbNormalFocus
-
Sep 2nd, 2006, 10:19 AM
#5
Re: How to run a bat file in vb
Do you mean something like this?
-
Sep 2nd, 2006, 10:19 AM
#6
Thread Starter
Addicted Member
Re: How to run a bat file in vb
no i want to make text1 show what is happening in the cmd window
-
Sep 2nd, 2006, 10:32 AM
#7
Re: How to run a bat file in vb
 Originally Posted by Gunner54
humm... i mean like i have a window that is like commad prompt so i can see it running
The link to the code i gave shows exactly what you're after, but with one difference, that it's now showing what's happening in the cmd window, but by creating proccess and displaying output results
-
Sep 2nd, 2006, 10:33 AM
#8
Thread Starter
Addicted Member
Re: How to run a bat file in vb
that code seems strange... i dont know what i need
-
Sep 2nd, 2006, 10:35 AM
#9
Thread Starter
Addicted Member
Re: How to run a bat file in vb
were do i put my bat file dir
-
Sep 2nd, 2006, 10:37 AM
#10
Re: How to run a bat file in vb
You don't need to use the batch file. Type the proccess and click a button - it will show you the output - usage is written in the code.
-
Sep 2nd, 2006, 10:39 AM
#11
Thread Starter
Addicted Member
Re: How to run a bat file in vb
a button called... see i dont know what tools i need i didnt know i needed a button but whats the button called command1 or cmd1 i need a text box too whats that called....
-
Sep 4th, 2006, 05:02 PM
#12
Hyperactive Member
Re: How to run a bat file in vb
do you need to see the text as the batch file runs, or could you get away with just seeing it after it gets done running?
if you only need it after the fact, it is really easy to get that text.
just add a ">" to your batch file command line, and specify a textfile name. the output that usually goes to the screen will be redirected to the text file. example:
'saves your ipconfiguration to textfile - "c:\ip.txt"
shell ("cmd.exe /c ipconfig > c:\ip.txt")
once it a text file, you can easily load it intoa textbox. examples abound.
good luck!
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
|