0

Hello everyone, I'm a making a BAT file creator and I can't find a way to add a 'Test' feature (open without saving)
This is the code I tried using:

    Shell("command.Text")

*Doesn't shell start DOS?
command.text=that's where users wrtie a code

Can someone give me a working code on how to make dos run commands for a bat file without opening it?
llike writing and runing a command and something like that :-/

Edited by DyO1

2
Contributors
5
Replies
15
Views
4 Years
Discussion Span
Last Post by DyO1
0

Yes, command is what the text box name's is!
Tried that code and it says File Not Found, same with the double quotes.

0

Here's a WORKING code:

       System.IO.Directory.CreateDirectory("C:\BATman Temp\")
        Dim writer As New IO.StreamWriter("C:\BATman Temp\testfile.bat")
        writer.Write(command.Text) 
        writer.Close() 
        System.Diagnostics.Process.Start("C:\BATman Temp\testfile.bat")

'C:\BATman Temp\ is the temp directory
'testfile.bat is the temp file name
'after saving it executes with System.Diagnostics.Process.Start
0

Made it anyways...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.