How to Code .Bat Files

Write your "How To" regarding anything you are comfortable with and you feel it will help the forum members.

NOTE :: All threads started here will appear only after the approval from Administrator
Post Reply
ag3nt
Posts: 80
Joined: Mon Apr 30, 2007 6:57 pm

How to Code .Bat Files

Post by ag3nt »

Hi all.

There is a method that you can create basic applications with it.Yes its batch language.Create a blank text file and name it appname.bat and open it with notepad or any text editor.Now i will teach some codes about it

Commands List:

md
md foldername : Creates a blank folder with selected name.

rd
rd foldername : Deletes a blank folder.

del
del filename : Deletes a file like ("c:\x.txt")

can be used like
del *.txt
del *.*

echo
echo somethinghere
Writes selected text to screen.
echo off
If you write this to top of .bat file user cannot see commands when execute your application.


@echo
Same with echo but user doesnt see echo command when you use this.

dir
Lists all files in the app directory if no parameters set.

call
call otherapp.bat: Opens another .bat application that set in parameter.

start
start filename.extension: Opens another application with any extensions set.
And this opens things in new window.

cls: Clears the screen

ren
ren filename newname: Renames the file with a new name.

type
type dosyaadi: Includes a files text to your application.

Example:
type ****.txt

move
move filename filename: Allows coder to move a file.

exit
Ends program.

Written by ag3nt.


New And Crazy Member Of SmokyHosts Community

By Ag3nt
SHAdmin
Posts: 2095
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post by SHAdmin »

Your 'How To' has been approved and you have been credited 15 points for sharing it.
Post Reply