Introduction: Batch Maker

UPDATE V2.0 NOW OUT!!! DOWNLOAD BELOW

This is a project i have been working on for a little wile..
it is made with vb.net 2008 and it makes making a batch simple for the newbies...

!!!!!!!!PLEASE NOTE!!!!!!!!!!!!!
THIS WILL ONLY WORK ON VISTA
it's because i made this on Vista now when i try it on an XP machine it comes up with an error message.. sorry people.

I have to thank TATcreator because even know he doesn't know it he gave me the idea to make this .. lol.


Make sure you look at the First step 'installation' before downloading!!!!


I really hope you like it..
and if you find any problems with it please leave a comment or pm me so i can fix them and repost it...

please comment on what you think to and don't forget to rate it =)

Step 1: Installation

To install follow the steps and pics closely!!!
1) Follow pic 1 if you just get a page with alot of text when you click on the link

2)Click save

3) Make sure you get all the red bits right!!!
Save as .exe And Make sure you save as 'All Files' or it will not work!!!!!

Step 2: How It Works: Part1

The ComboBox


As i said i made it with vb 2008 so there is no batch scripting.
To make it all i really had to do was:


if 'write' is selected in combobox
change label2 to 'Write a message - Do not add the echo!'
show textbox1
change textbox1 text to 'What do you want it to say?'

Which turns out as:

If ComboBox1.SelectedItem = ("Write") Then
Label2.Text = ("Write a message - Do not add the echo!")
TextBox1.Show()
TextBox1.Text = ("What do you want it to say?")
End If

I had to keep doing this for every item on the combobox.

Step 3: How It Works: Part2

The Buttons


The buttons were one of the hardest things to do,

The Add Button

For the add button to work I had to do a lot of coding but once I had done that the rest was fairly simple...
Part of the add code:

if 'Write' is Selected in combo box then
add 'echo ' + contents of textbox1
end

Which turnes out as:

If ComboBox1.SelectedItem = ("Write") Then
ListBox1.Items.Add("echo " + TextBox1.Text)
End If

it was mostly the same for most of them, as shown in the pic.

The remove button is just:
Remove selected item from list
which is:

ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)

the clear button just clears the whole list then adds the first two lines again:

ListBox1.Items.Clear()
ListBox1.Items.Add("::Made With iRule Batch Maker")
ListBox1.Items.Add("@echo off")

and the move up and down code just move selected item up or down:
(code to long to put up)

Step 4: How It Works: Part3

The Save/Load


The Save and Load were probably the hardest part,
This is just the save code:

Dim sfdMain As New SaveFileDialog
sfdMain.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
Dim Result As DialogResult
sfdMain.Filter = "Batch Files (*.bat)|*.bat| CMD Files(*.cmd)|*.cmd"
sfdMain.FilterIndex = 1
sfdMain.ValidateNames = True
Result = sfdMain.ShowDialog
If Result = Windows.Forms.DialogResult.OK Then
Dim sw As New System.IO.StreamWriter(sfdMain.FileName)
For i As Integer = 0 To ListBox1.Items.Count - 1
sw.WriteLine(ListBox1.Items.Item(i))
Next
sw.Close()
sw.Dispose()
Else
Exit Sub
End If

if you understand vb you will know what that does but if you don't:
basically, all it does is show the save dialog, and it saves all the contents of the list into a batch file or cmd file

Comments

author
xp4xbox (author)2016-12-09

i know this is a bit late, but I think the reason why it would not work on older systems, is because there is no current .NET framework installed.

author
xp4xbox (author)2016-01-31

works for my win xp computer.

author
XThePCCrackerX (author)2014-06-28

Hey,nice work. I was just wondering if you could make a tutorial on your "MakeABatch.exe" program. I DO have VB 2008 and I DO know how to code in both Batch(.bat) and Visual Basic(VB).

Thanks anyway.

author
XThePCCrackerX (author)2014-06-28

Hey,nice work. I was just wondering if you could make a tutorial on your "MakeABatch.exe" program. I DO have VB 2008 and I DO know how to code in both Batch(.bat) and Visual Basic(VB).

Thanks anyway.

author
ShadowShifter (author)2013-10-31

Hello!

author
crazy lazy man (author)2013-07-15

got it, im using chrome and xp just download it and rename it to what you want.exe

author
Chad Baxter (author)2012-11-07

chrome...doesnt work for dl.....i suggest a dropbox link...

author
will421 (author)2009-05-29

When I click on the X when I accidentally poped up the Edit Command popup it said "The value of "index" cannot be "-1"" and the (unhelpful) details button said:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '-1' is not valid for 'index'.
Parameter name: index
at System.Windows.Forms.ListBox.ObjectCollection.Insert(Int32 index, Object item)
at MakeABatch.Start.ListBox1_MouseDoubleClick(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDoubleClick(MouseEventArgs e)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll


MakeABatch
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Bob/My%20Documents/Will%60s%20files/MakeABatch.exe

Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll


************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

author
iRule (author)will4212009-06-01

invlaid move menu was trying to set menu item at -1 when lowest is 0

author
will421 (author)iRule2009-06-02

Heh, the lowest value for a array`s data in C++ (and maybe C) is 1, very confusing for beginners.

author
iRule (author)will4212009-06-07

i used vb.net but it still could be 1 =/ ... ether way it was trying to set to low =]

author
michaelb958 (author)iRule2011-04-18

Um, what? C, C++, C# and VB.NET index their arrays from zero.
* VB.NET: heaven knows why... but see http://msdn.microsoft.com/en-us/library/2k7ayc03%28v=VS.80%29.aspx anyway.
* In C, it was pointer-array equivalence. In C, array[index] == *(array + index). So the first element had to be element 0 or you lost space equal to the size of the type held by the array, and back in 1972 that was a Bad Thing.
* C++ and C# desired backwards compatibility with C. See above.

On the other hand, several languages index from 1, and one (I think) indexed from a programmer-specified positive integer. Either way, accessing negatively-indexed array items is Not A Good Idea.

author
will421 (author)michaelb9582011-09-07

Sorry. I was dumb back then.

author
will421 (author)will4212009-05-29

Ignore the links.

author
michaelb958 (author)2010-08-30

Executable excellence! I'm a bit past the stage where I need this, but it's quite a good program. In fact, you've inspired me to create Script Maker, an application which allows you to create [in this manner] batch files and VBScripts [with WScript or CScript]. I might even include JavaScript in version 2.0.

author
iRule (author)michaelb9582010-09-03

glad i could be an inspiration.. and id like to see an end product.. it will be far better than mine lol -iRule

author
michaelb958 (author)iRule2010-12-10

Script Maker was getting too complicated, so I scrapped it and moved on to something a bit easier - C. (That's the programming language.) I figure I could have the program read subroutines out of the libraries.

author
iRule (author)michaelb9582011-04-02

i have come in contact with C# a few times but over all whenever i use that kinda scripting i use VB.NET, so would be interesting to see how you did, either way good luck with it!

author
michaelb958 (author)2010-10-05

You could simplify that code immensely by using Select Case instead of all those Ifs.

author
maxoomen (author)2010-08-05

It works also on windows XP you only need to download the newest version of microsoft .net

author
account3r2 (author)2010-07-08

:( i dont have vista. i only have xp. i love batch and things.

author
iRule (author)account3r22010-07-08

i think this will still work as long as you have the .NET framework .. and if you don't, a couple of comments down tells you where to get it :) please tell if you get it to work.

author
lunchboxslayer27 (author)2009-10-30

if it doesnt work for you, save the .tmp file, and just rename it to *whatever you want*.bat. it didnt work for me as an exe, but it worked as a tmp renamed to a bat

author
erikals (author)2009-07-13

got this to work in xp, cool Great work. I like it.

author
Jakash3 (author)2009-05-27

For those of you who cannot run this, you probably don't have .NET Framework installed. This is needed in order to run programs that were programmed in Visual Basic .NET

Download it here: http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en

author
will421 (author)Jakash32009-06-01

Taking a longlonglonglonglonglonglonglonglonglonglonglonglonglonglong time to download...

author
will421 (author)will4212009-06-01

*sigh* That time was wasted...

author
will421 (author)will4212009-06-15

Or not. But when I try to run MakeABatch.exe it just shows this error message "C:/windows/Microsoft.NET/Framework/v2.0.50727/mscorwks.dll could not be loaded". Help?

author
iRule (author)will4212009-06-17

just a guess here but do you even have the windows folder on Wine?

author
will421 (author)iRule2009-06-18

Yes.

author
iRule (author)will4212009-06-19

OK then i guess my batch maker and the .NET framework just hate you Don't no why its not working soz

author
will421 (author)Jakash32009-05-29

Wine will not take anything from Microsoft.

author
will421 (author)will4212009-05-29

Not even IE. *sigh*

author
fwjs28 (author)will4212009-05-31

then you probably don't have WINe configured correctly (and why would you want IE when linux has far superior browsers to any MS browser)

author
will421 (author)fwjs282009-06-01

It does have its own (crappy) version of IE! And I want Microsoft`s IE because of VBS. (It won`t even understand stand-alone VBS scripts!)

author
TATcreator (author)2009-02-25

You are welcome.

author
will421 (author)TATcreator2009-05-29

You mean Your welcome, I`m right, right?

author
fwjs28 (author)will4212009-05-31

not You're welcome is the proper term or better yet is You are...

author
will421 (author)fwjs282009-06-01

Oops, brain got stuck.

author
fwjs28 (author)will4212009-06-01

then get it un-stuck (im guessing by now its un-stuck(ed-ed?)

author
will421 (author)fwjs282009-06-02

It was stuck, like, 19 days ago and 1 minute ago. Don`t you think that I would have unstuck before now? P.S. I was actually thinking of you`re but then my brain shortned it to your.

author
fwjs28 (author)will4212009-06-03

some people take time to get un-stuck...just checking...ps, you comprise of like 99% of the comments i receive, lol

author
will421 (author)fwjs282009-06-07

And I have 99 comments right now...

author
fwjs28 (author)will4212009-06-08

woot?

author
iRule (author)fwjs282009-06-09

-_- seriously whats with the massive convo?

author
fwjs28 (author)iRule2009-06-09

massive?

author
will421 (author)fwjs282009-06-09

289 comments!!!!!!!!!!!!!!!!!

author
fwjs28 (author)will4212009-06-09

o...

author
iRule (author)2009-06-08

it can work with xp if you have the .NET framework newer xp machines should have it but older ones wont be able to run this .... you can easily go to download.com, Microsoft, to get it.

author
Arbitror (author)2009-01-13

Very Good! But, I think that this tool is only useful to people who are new to batch programming (n00bs). It helps them learn about the different commands. But, professional batch programmers (Like me...) are better off just writing code blocks the old fashion way, that is, in notepad. It's easier and faster especially if you have memorized almost every command!

About This Instructable

4,340views

12favorites

License:

More by iRule:Screen Lock (VB.NET)VBS Tutorial - BasicsBatch Maker
Add instructable to: