KEMBAR78
Py BAT File Commands Complete List | PDF
0% found this document useful (0 votes)
60 views3 pages

Py BAT File Commands Complete List

The document provides a comprehensive list of BAT file commands categorized into Basic Commands, File and Directory Management, Logic and Flow Control, Looping, Variables, System Information & Control, Networking, and User and Admin Commands. It includes examples for some commands and a sample BAT file demonstrating their usage. Each command is briefly described for clarity.

Uploaded by

proxybeta412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views3 pages

Py BAT File Commands Complete List

The document provides a comprehensive list of BAT file commands categorized into Basic Commands, File and Directory Management, Logic and Flow Control, Looping, Variables, System Information & Control, Networking, and User and Admin Commands. It includes examples for some commands and a sample BAT file demonstrating their usage. Each command is briefly described for clarity.

Uploaded by

proxybeta412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Complete List of BAT File Commands

Basic Commands

echo - Displays messages or turns command echoing on/off

@echo off - Hides the commands as they are executed

rem - Adds a comment

pause - Pauses the batch file and waits for user input

cls - Clears the screen

exit - Exits the script or command prompt

File and Directory Management

dir - Lists files and directories

cd / chdir - Changes the current directory

md / mkdir - Creates a new directory

rd / rmdir - Removes a directory

del - Deletes a file

copy - Copies files from one location to another

xcopy - Extended copy command for files and folders

move - Moves files from one folder to another

ren / rename - Renames a file or folder

Logic and Flow Control

if - Conditional logic (e.g., if A==B)

if exist - Checks if a file or folder exists

goto - Jumps to a labeled section

:label - Creates a label to jump to

call - Calls another batch file or function

choice - Prompts user for a choice

setlocal / endlocal - Controls variable scope


Complete List of BAT File Commands

Looping

for - Loops over a set of values or files

Example: - for %%i in (*.txt) do echo %%i

Variables

set - Creates or modifies variables

set /p - Prompts the user to input a value

set /a - Performs arithmetic operations

System Information & Control

systeminfo - Displays system configuration

tasklist - Lists running processes

taskkill - Ends tasks by name or PID

shutdown - Shuts down or restarts the system

time / date - Displays or sets the system time/date

Networking

ipconfig - Shows IP configuration

ping - Tests network connection

netstat - Shows network stats

tracert - Traces route to a host

net - Manages users, shares, network connections

User and Admin Commands

net user - Manage user accounts


Complete List of BAT File Commands

runas - Run a command as another user

whoami - Shows the current user

attrib - Changes file attributes (read-only, hidden, etc.)

Example: Sample BAT File

@echo off

echo Welcome to my Batch File

set /p name=Enter your name:

echo Hello, %name%!

pause

You might also like