Instructables

How to make Batch files Install any file!

Picture of How to make Batch files Install any file!
Ever want to give a download on an instructable, but it has to be in the correct folder? Here's how you can make a simple installer that can create multiple files, given you created it correctly. You will need

-a Windows NT (or higher) computer
-patience
-a file you want to install
-a place to put the file
 
Remove these adsRemove these ads by Signing Up

Step 1: The most basic of text editing

Before we start programming we are going to have to open notepad.

Windows 95-2000
Start>Programs>Acessories>Notepad

Windows XP-7

Start>All Programs>Acessories>Notepad

Then proceed to the next step.

Step 2: The Code

Picture of The Code
This time you have to create the code. But I will show you how. Make sure you write down the code in notepad.

Say you file has two lines that are

This is the best instructable ever!
Thanks to Super_Nerd

And you want to put it in the filepath

C:\Users\ Users name goes here\Desktop

You start the code with

@echo off

Otherwise every command would have a C:\Windows\System 32 in front of it.

Then for every line in the file put

echo data in the line>>filepath

For the filepath involving the username where the username has to be, put

%USERNAME%

So in our case the code would be

@echo off

echo This is the best instructable ever!>>C:\Users\%Username%\Desktop\file.txt
echo Thanks to Super_Nerd>>C:\Users\%Username%\Desktop\file.txt

exit

Say you want to overwrite a file. To do so just make the >> to an >

> = Overwrite
>> = Add to file

Therefore to overwrite, make the first line have a > and the rest have >>.

See where the code says file.txt? That is the filename. Feel free to change it to whatever you want. If you don't add an extention it turns into a file. Confusing right? A file is a file with no extention, hence you have to choose what to open it with every time.

Step 3: Adding the 1s and 0s to the drive

Picture of Adding the 1s and 0s to the drive
AKA saving the file

Save it as something like installer.bat

It can be whatever you want as long as it ends in .bat or .cmd

Step 4: Fire it up!

Picture of Fire it up!
Now test your new creation by double clicking on the icon with the gears. As always comment any problems or ideas you had.

See Ya!
jakejakey1208 made it!1 month ago

I Have Created A Batch File That will let you create installer.exe files for free and very easily.
All you need is my InstallMaker.bat file and then it will say loading give it a second and then it will open the install maker.

TESTED ON WINDOWS 8 [It Works]

NOT SURE FOR OTHER OPERATING SYSTEMS

This is 100% free and only 1 file must be downloaded.

DOWNLOAD: http://www.mediafire.com/download/hlkw8r1v4o4vt4f/InstallMaker.bat

bandicam 2014-06-11 21-21-28-395.jpg
Why did you put VBs in the starting image?

(Someone could get confused).
Super_Nerd (author)  Prof. Pickle1 year ago
Actually that is the WinXP image for a batch file. The image for a VBS file looks like this
VBS.png
Sorry, I meant the image at step 1

Sorry for the confusions
Super_Nerd (author)  Prof. Pickle1 year ago
Well the picture is more for the image of notepad than the code in it.
Fair enough.
Why don't you join the Batch Homies Group and post your Batch Instructables?
http://www.instructables.com/group/BatchHomies/
Not really an installer... As far as I can see, it's writing strings to a file. Pree basic stuff, but good instructable :)
Super_Nerd (author)  threeflashes2 years ago
Well, it can be used to behave like an installer. Oh well, thanks for reading!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!