This document provides information on the AddUsers.exe and ARP.exe Windows commands and the ASSOC command. It describes:
- AddUsers.exe automates creating large numbers of user accounts from a comma-delimited file and has options to create, dump, or erase accounts.
- ARP.exe displays and modifies the IP to physical address translation tables used for address resolution, allowing the viewing, adding, and deleting of ARP entries.
- ASSOC associates file extensions with file types in Windows so applications know what type of file it is based on the extension. It allows displaying, adding, and changing the file type associated with an extension.
Tool Development 08 - Windows Command PromptNick Pruehs
Chapter 08 of the lecture Tool Development taught at SAE Institute Hamburg.
Introduction to the windows command prompt, and command-line arguments and calling external programs in .NET.
The document provides an overview of shells and their functions. It discusses how shells interpret commands, execute utilities by launching child processes, and customize functionality through variables and startup files. Key points include shells acting as an interface between the user and kernel by translating commands, child processes inheriting environments, and customizations like aliases, prompts, and startup files tailoring each shell.
The split utility breaks long files into smaller files, the lp and lpr utilities manage printing, and find searches for files meeting criteria and acts on them. Mtools copies files to DOS floppies, while tar archives a directory tree or file into a single file for storage, transfer, or relocation.
This document provides an overview of the Linux operating system. It discusses key Linux concepts like the kernel, shell, file system structure, permissions, users and groups. It also summarizes important commands for navigating and managing files, directories, users, software and services in Linux. These include commands like ls, cd, mkdir, chmod, useradd, yum, service and chkconfig. The document outlines the directory structure in Linux and describes important directories like /bin, /home, /etc. It also covers processes, pipes, redirection and Linux file systems & partitions.
The document discusses managing files and directories in Linux/Unix systems. It covers topics such as using directories to organize files, listing and accessing files in directories, creating and removing directories, using pathnames to navigate between directories, and managing files located in multiple directories.
The document provides an overview of the Linux operating system. It discusses key Linux concepts like the kernel, shell, file structure, users and permissions. It also summarizes common Linux commands for file management, editing, users, groups, software installation and services. Key tools covered include vi editor, rpm, tar, useradd/del, service and chkconfig. The document is intended as part of an introductory Linux presentation.
This document provides an overview of system administrator tasks and basic UNIX concepts. It discusses the roles and responsibilities of system administrators, the structure and components of UNIX operating systems, basic commands for navigating the file system, managing files and directories, editing text, and running processes. It also covers shells, variables, and cron jobs for scheduling automated tasks. The document concludes with introductions to AIX operating systems and IBM pSeries servers.
The document provides an overview of essential Linux commands and programs for navigating the file system, examining and managing files, and accessing utilities and documentation. It discusses the development of UNIX and Linux, basic commands for executing utilities like date and hostname, passing arguments to utilities, listing processes with ps, and redirecting outputs. It also covers navigating directories, copying, moving, removing files, and deciphering error messages.
Tool Development 08 - Windows Command PromptNick Pruehs
Chapter 08 of the lecture Tool Development taught at SAE Institute Hamburg.
Introduction to the windows command prompt, and command-line arguments and calling external programs in .NET.
The document provides an overview of shells and their functions. It discusses how shells interpret commands, execute utilities by launching child processes, and customize functionality through variables and startup files. Key points include shells acting as an interface between the user and kernel by translating commands, child processes inheriting environments, and customizations like aliases, prompts, and startup files tailoring each shell.
The split utility breaks long files into smaller files, the lp and lpr utilities manage printing, and find searches for files meeting criteria and acts on them. Mtools copies files to DOS floppies, while tar archives a directory tree or file into a single file for storage, transfer, or relocation.
This document provides an overview of the Linux operating system. It discusses key Linux concepts like the kernel, shell, file system structure, permissions, users and groups. It also summarizes important commands for navigating and managing files, directories, users, software and services in Linux. These include commands like ls, cd, mkdir, chmod, useradd, yum, service and chkconfig. The document outlines the directory structure in Linux and describes important directories like /bin, /home, /etc. It also covers processes, pipes, redirection and Linux file systems & partitions.
The document discusses managing files and directories in Linux/Unix systems. It covers topics such as using directories to organize files, listing and accessing files in directories, creating and removing directories, using pathnames to navigate between directories, and managing files located in multiple directories.
The document provides an overview of the Linux operating system. It discusses key Linux concepts like the kernel, shell, file structure, users and permissions. It also summarizes common Linux commands for file management, editing, users, groups, software installation and services. Key tools covered include vi editor, rpm, tar, useradd/del, service and chkconfig. The document is intended as part of an introductory Linux presentation.
This document provides an overview of system administrator tasks and basic UNIX concepts. It discusses the roles and responsibilities of system administrators, the structure and components of UNIX operating systems, basic commands for navigating the file system, managing files and directories, editing text, and running processes. It also covers shells, variables, and cron jobs for scheduling automated tasks. The document concludes with introductions to AIX operating systems and IBM pSeries servers.
The document provides an overview of essential Linux commands and programs for navigating the file system, examining and managing files, and accessing utilities and documentation. It discusses the development of UNIX and Linux, basic commands for executing utilities like date and hostname, passing arguments to utilities, listing processes with ps, and redirecting outputs. It also covers navigating directories, copying, moving, removing files, and deciphering error messages.
This document discusses using utilities to accomplish complex tasks in scripts. It covers creating a script to list user information, separately listing directories and files, and identifying changes made to files in a directory. Key utilities discussed include ls, grep, sort, uniq, diff, and tr which can be combined in scripts to manipulate and analyze data in powerful ways. Comments are added to scripts using # and utilities are piped together using |.
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
This document provides an overview of Unix users and file permissions. It discusses the different types of users in Unix including root, system, and general users. It also covers file permissions in terms of ownership levels, permission types, and how to change permissions using the chmod command in both symbolic and octal modes. Examples are provided for managing users and groups as well as setting permissions on files and directories. The document contains content for a training course on Unix users and file permissions.
This program implements the First Come First Serve (FCFS) CPU scheduling algorithm in C. It takes the arrival time and service time of each process as input, calculates the start time, finish time, waiting time and turnaround time of each process, and outputs these values along with the average waiting time and average turnaround time. The processes are scheduled in the order of their arrival, with no preemption, following the FCFS principle.
The document discusses file and directory permissions in Linux/Unix systems. It describes how permissions are represented and controlled using commands like ls, chmod, and umask. Permissions determine whether a user can read, write, or execute files and view contents of directories. Chmod allows setting permissions for owners, groups and others using letters or numbers. Umask sets default permissions for new files and directories based on permissions being masked.
This document discusses managing and processing processes in a system. It explains that every running program is a separate process with a unique process ID. It describes how to obtain information on running processes, start new processes, and end processes through various commands. It also covers job control in UNIX, allowing users to start, suspend, resume, and kill groups of processes associated with a job.
Slides from the Introduction to UNIX Command-Lines class from the BTI Plant Bioinformatics course 2014. This is a course teach by the Sol Genomics Network researchers at the Boyce Thompson Institute.
This Operating System lab manual is designed strictly according to BPUT Syllabus.Any suggestions or comments are well come at neelamani.samal@gmail.com
This document provides an overview of basic Unix commands, including:
- Commands for navigating directories (cd, pwd, ls), creating/removing directories and files (mkdir, rmdir, cp, rm)
- Commands for viewing file contents (cat, more, less) and comparing files (diff)
- Commands for searching files (grep) and counting elements (wc)
- Commands for changing file permissions (chmod) and moving/renaming files (mv)
It also briefly describes shells, files and pathnames in Unix systems. The document is intended as an introduction for new Unix users to understand basic file management and navigation.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
This document provides an index of 21 coding topics that include performing arithmetic operations, comparison of numbers, compound interest calculation, prime number checking, and palindrome checking. It also includes displaying a Fibonacci series, calculating simple interest, and swapping numbers without using three variables. The index provides the topic name and number for each item.
P2Cinfotech is one of the leading, Online IT Training facilities and Job Consultant, spread all over the world. We have successfully conducted online classes on various Software Technologies that are currently in Demand. To name a few, we provide quality online training for QA, QTP, Manual Testing, HP LoadRunner, BA, Java Technologies.
Unique Features of P2Cinfotech:
1. All online software Training Batches will Be handled by Real time working Professionals only.
2. Live online training like Real time face to face, Instructor ? student interaction.
3. Good online training virtual class room environment.
4. Special Exercises and Assignments to make you self-confident on your course subject.
5. Interactive Sessions to update students with latest Developments on the particular course.
6. Flexible Batch Timings and proper timetable.
7. Affordable, decent and Flexible fee structure.
8. Extended Technical assistance even after completion of the course.
9. 100% Job Assistance and Guidance.
Courses What we cover:
Quality Assurance
Business Analsis
QTp
JAVA
Apps Devlepoment Training
Register for Free DEMO:
www.p2cinfotech.com p2cinfotech@gmail.com +1-732-546-3607 (USA)
This document provides an A-Z index of commands for the Apple OS X command line, listing over 200 commands and their brief descriptions. It includes basic commands for file management, text processing, networking, system administration, and more. The document also notes that bash is the default shell for OS X and that many commands are built-in bash commands.
The document discusses internal commands in DOS. It defines internal commands as built-in commands that are loaded with the operating system into memory during booting and remain resident as long as the computer is on. It provides examples of common internal commands like DIR, COPY, DEL, TYPE, CD, MD, RD, and explains what each command does and provides sample syntax. The document also discusses conventions used in command descriptions and provides examples of using wildcards with commands.
PC Software - Computer Application - Office Automation Toolszatax
The document provides an index and overview of commands and functions for Microsoft DOS and Windows. It includes sections on basic DOS commands, the concept of Windows, creating folders and files, word processing, spreadsheets, presentations, and using the internet. Examples are provided for various DOS commands like DIR, MD, RD, CD, COPY, DEL, REN, and TYPE. Internal and external DOS commands are also categorized in a table.
Basic of and Unix and Command. More presentation you can find on www.scmGalaxy.com.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
The document provides an overview of the vi text editor, describing how to navigate and edit files, add and delete text, search for text, and save files. Vi has two modes - command mode for navigation and append/insert mode for adding text. It allows moving cursor, searching, deleting lines/characters, undoing changes, and quitting to save files. Advanced features include substituting text globally and marking blocks to move or copy.
This document provides instructions for various exercises to be completed as part of an Operating Systems lab manual. It includes exercises on system calls like fork, exec, wait; I/O system calls; simulating commands like ls and grep; scheduling algorithms like FCFS, SJF, priority, round robin; inter-process communication using shared memory, pipes, message queues; the producer-consumer problem using semaphores; and memory management schemes including paging, segmentation, and file allocation techniques. Example code is provided for implementing different memory management algorithms using concepts like free space list, allocated space list, and block merging.
The document provides an overview of various Unix/Linux command line concepts across 5 chapters. It describes commands for listing files and directories (ls), creating directories (mkdir), changing directories (cd), viewing the current directory (pwd), copying, moving and removing files (cp, mv, rm), searching files (grep), viewing processes (ps), running jobs in background (&), managing jobs (jobs, fg, bg) and killing processes (kill). It also covers file permissions (chmod), symbolic and hard links (ln), input/output redirection (> ,|), piping (|) and getting help (man, whatis).
Writing Modular Command-line Apps with App::CmdRicardo Signes
It's easy to write command-line programs in Perl. There are a million option parsers to choose from, and Perl makes it easy to deal with input, output, and all that stuff.
Once your program has gotten beyond just taking a few switches, though, it can be difficult to maintain a clear interface and well-tested code. App::Cmd is a lightweight framework for writing easy to manage CLI programs.
This talk provides an introduction to writing programs with App::Cmd.
Asynchronous Transfer Mode (ATM) is a cell-based switching and multiplexing technology that was designed in the early 1990s to expedite the transmission of voice, video, and data over digital networks. ATM uses fixed-length cells of 53 bytes to carry traffic. It establishes virtual connections between endpoints to guarantee quality of service. ATM works by segmenting data into fixed-size cells at the source, transporting cells through a switch network via virtual circuits, and reassembling them at the destination. It provides benefits like high performance, integration of multiple data types, and adaptability to different network speeds.
This document discusses using utilities to accomplish complex tasks in scripts. It covers creating a script to list user information, separately listing directories and files, and identifying changes made to files in a directory. Key utilities discussed include ls, grep, sort, uniq, diff, and tr which can be combined in scripts to manipulate and analyze data in powerful ways. Comments are added to scripts using # and utilities are piped together using |.
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
This document provides an overview of Unix users and file permissions. It discusses the different types of users in Unix including root, system, and general users. It also covers file permissions in terms of ownership levels, permission types, and how to change permissions using the chmod command in both symbolic and octal modes. Examples are provided for managing users and groups as well as setting permissions on files and directories. The document contains content for a training course on Unix users and file permissions.
This program implements the First Come First Serve (FCFS) CPU scheduling algorithm in C. It takes the arrival time and service time of each process as input, calculates the start time, finish time, waiting time and turnaround time of each process, and outputs these values along with the average waiting time and average turnaround time. The processes are scheduled in the order of their arrival, with no preemption, following the FCFS principle.
The document discusses file and directory permissions in Linux/Unix systems. It describes how permissions are represented and controlled using commands like ls, chmod, and umask. Permissions determine whether a user can read, write, or execute files and view contents of directories. Chmod allows setting permissions for owners, groups and others using letters or numbers. Umask sets default permissions for new files and directories based on permissions being masked.
This document discusses managing and processing processes in a system. It explains that every running program is a separate process with a unique process ID. It describes how to obtain information on running processes, start new processes, and end processes through various commands. It also covers job control in UNIX, allowing users to start, suspend, resume, and kill groups of processes associated with a job.
Slides from the Introduction to UNIX Command-Lines class from the BTI Plant Bioinformatics course 2014. This is a course teach by the Sol Genomics Network researchers at the Boyce Thompson Institute.
This Operating System lab manual is designed strictly according to BPUT Syllabus.Any suggestions or comments are well come at neelamani.samal@gmail.com
This document provides an overview of basic Unix commands, including:
- Commands for navigating directories (cd, pwd, ls), creating/removing directories and files (mkdir, rmdir, cp, rm)
- Commands for viewing file contents (cat, more, less) and comparing files (diff)
- Commands for searching files (grep) and counting elements (wc)
- Commands for changing file permissions (chmod) and moving/renaming files (mv)
It also briefly describes shells, files and pathnames in Unix systems. The document is intended as an introduction for new Unix users to understand basic file management and navigation.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
This document provides an index of 21 coding topics that include performing arithmetic operations, comparison of numbers, compound interest calculation, prime number checking, and palindrome checking. It also includes displaying a Fibonacci series, calculating simple interest, and swapping numbers without using three variables. The index provides the topic name and number for each item.
P2Cinfotech is one of the leading, Online IT Training facilities and Job Consultant, spread all over the world. We have successfully conducted online classes on various Software Technologies that are currently in Demand. To name a few, we provide quality online training for QA, QTP, Manual Testing, HP LoadRunner, BA, Java Technologies.
Unique Features of P2Cinfotech:
1. All online software Training Batches will Be handled by Real time working Professionals only.
2. Live online training like Real time face to face, Instructor ? student interaction.
3. Good online training virtual class room environment.
4. Special Exercises and Assignments to make you self-confident on your course subject.
5. Interactive Sessions to update students with latest Developments on the particular course.
6. Flexible Batch Timings and proper timetable.
7. Affordable, decent and Flexible fee structure.
8. Extended Technical assistance even after completion of the course.
9. 100% Job Assistance and Guidance.
Courses What we cover:
Quality Assurance
Business Analsis
QTp
JAVA
Apps Devlepoment Training
Register for Free DEMO:
www.p2cinfotech.com p2cinfotech@gmail.com +1-732-546-3607 (USA)
This document provides an A-Z index of commands for the Apple OS X command line, listing over 200 commands and their brief descriptions. It includes basic commands for file management, text processing, networking, system administration, and more. The document also notes that bash is the default shell for OS X and that many commands are built-in bash commands.
The document discusses internal commands in DOS. It defines internal commands as built-in commands that are loaded with the operating system into memory during booting and remain resident as long as the computer is on. It provides examples of common internal commands like DIR, COPY, DEL, TYPE, CD, MD, RD, and explains what each command does and provides sample syntax. The document also discusses conventions used in command descriptions and provides examples of using wildcards with commands.
PC Software - Computer Application - Office Automation Toolszatax
The document provides an index and overview of commands and functions for Microsoft DOS and Windows. It includes sections on basic DOS commands, the concept of Windows, creating folders and files, word processing, spreadsheets, presentations, and using the internet. Examples are provided for various DOS commands like DIR, MD, RD, CD, COPY, DEL, REN, and TYPE. Internal and external DOS commands are also categorized in a table.
Basic of and Unix and Command. More presentation you can find on www.scmGalaxy.com.
scmGalaxy.com is dedicated to software configuration, build and Release management. This covers CVS, VSS (Visual Source Safe),Perforce, SVN(Subversion) MKS Integrity, ClearCase,TFS,CM Synergy, Best Practices ,AnthillPro, Apache Ant, Maven, Bamboo, Cruise Control and many more tools.
The document provides an overview of the vi text editor, describing how to navigate and edit files, add and delete text, search for text, and save files. Vi has two modes - command mode for navigation and append/insert mode for adding text. It allows moving cursor, searching, deleting lines/characters, undoing changes, and quitting to save files. Advanced features include substituting text globally and marking blocks to move or copy.
This document provides instructions for various exercises to be completed as part of an Operating Systems lab manual. It includes exercises on system calls like fork, exec, wait; I/O system calls; simulating commands like ls and grep; scheduling algorithms like FCFS, SJF, priority, round robin; inter-process communication using shared memory, pipes, message queues; the producer-consumer problem using semaphores; and memory management schemes including paging, segmentation, and file allocation techniques. Example code is provided for implementing different memory management algorithms using concepts like free space list, allocated space list, and block merging.
The document provides an overview of various Unix/Linux command line concepts across 5 chapters. It describes commands for listing files and directories (ls), creating directories (mkdir), changing directories (cd), viewing the current directory (pwd), copying, moving and removing files (cp, mv, rm), searching files (grep), viewing processes (ps), running jobs in background (&), managing jobs (jobs, fg, bg) and killing processes (kill). It also covers file permissions (chmod), symbolic and hard links (ln), input/output redirection (> ,|), piping (|) and getting help (man, whatis).
Writing Modular Command-line Apps with App::CmdRicardo Signes
It's easy to write command-line programs in Perl. There are a million option parsers to choose from, and Perl makes it easy to deal with input, output, and all that stuff.
Once your program has gotten beyond just taking a few switches, though, it can be difficult to maintain a clear interface and well-tested code. App::Cmd is a lightweight framework for writing easy to manage CLI programs.
This talk provides an introduction to writing programs with App::Cmd.
Asynchronous Transfer Mode (ATM) is a cell-based switching and multiplexing technology that was designed in the early 1990s to expedite the transmission of voice, video, and data over digital networks. ATM uses fixed-length cells of 53 bytes to carry traffic. It establishes virtual connections between endpoints to guarantee quality of service. ATM works by segmenting data into fixed-size cells at the source, transporting cells through a switch network via virtual circuits, and reassembling them at the destination. It provides benefits like high performance, integration of multiple data types, and adaptability to different network speeds.
The document introduces the Microsoft Windows Command Prompt, which is an entry point for typing computer commands without using the graphical interface. The Command Prompt window allows users to perform tasks on their computer through command line commands. It is located by clicking the Start icon, searching for "command prompt" or "cmd", and can be run as an administrator by right clicking the application and selecting "Run as administrator".
A computer network is defined as the interconnection of two or more computers. It is done to enable the computers to communicate and share available resources.
Components of computer network
Network benefits
Disadvantages of computer network
Classification by their geographical area
Network classification by their component role
Types of servers
Html advanced-reference-guide for creating web formssatish 486
This document discusses creating web forms and frames using HTML. It provides information on:
1. What a web form is and the software needed to create one, including a text editor and FTP program.
2. How to initiate an HTML file and compose form tags, including specifying the action, method, and hidden mailto input to send form data to a CGI script.
3. Different input types like text, checkboxes, and their attributes for collecting user information in a form. Limitations of using the generic Ohio University CGI script are also outlined.
Traceroute is a utility that send an ICMP packets from our computer to user input destination and displays information about what is happening to the packet on each point along the path.
This presentation introduces Microsoft Powershell version 5. It defines what are commands and how can you use them to write scripts and classes in Powershell.
The document discusses communication, multimedia design, ambient intelligence, networking, and how they relate to mediocrity, presenting oneself, emotions, structure, social aspects, community, messaging, sharing, learning, domains, relaxation, organization, teaching, playing, and always learning and working to gain expertise. The topics covered include institutions, the world in 2013, and combinations of communication, multimedia, and ambient intelligence with networking and power.
See the top reasons once hot consumer, fashion and tech entrepreneurs and founders start to fail. The leadership issues that start to harm the culture, organization and sales.
This document provides examples of PowerPoint slides to demonstrate best practices for presentation skills. It shows examples of slides with issues like small text, lack of images or charts, spelling errors, and missing slides. The examples are meant to illustrate problems to avoid and better ways to structure slides so the information is clear, visually appealing and fully conveys the presenter's intended message.
This document proposes a mobile phone care company that would provide maintenance services for modern phones, buy and sell used phones, and sell old phones for recycling. The company would have an online store and website with sections for services, company information, contact details, FAQs, and potential online service support. Having an online presence rather than multiple stores and a single repair store would help reduce costs. Profits would come mainly from phone maintenance and selling used devices, with less from recycling. The business is viable due to the large and growing number of mobile phone users worldwide and people frequently upgrading devices.
Execute sql query or sql command sql server using command promptIkhwan Krisnadi
The document discusses using the SQLCMD command in the command prompt to execute SQL queries and scripts on a SQL Server. It provides the format for the SQLCMD command, an example SQL script that creates a table, and an example of running the SQLCMD command on the command prompt to execute the SQL script and output the results to a text file.
SyScan 2015 Bonus Slides - death of the vmsize=0 dyld trickStefan Esser
During my talk at SyScan 2015 i promised to disclose among all the fail of Apple how their patches for "Patient ALPHA" actually killed a previously unknown 0-day incomplete code signing vulnerability that was just waiting to be used in the next jailbreak.
This document provides an overview of key Excel concepts and tasks, including:
1) Excel is a program used to enter and analyze quantitative data in spreadsheets. It allows what-if analysis by changing values to assess impacts.
2) The tutorial covers navigating and exploring Excel, entering data, formulas and functions, formatting cells, inserting and deleting rows/columns/worksheets, and printing worksheets.
3) Formulas use operators to combine values from cells and return a single result. Functions are predefined formulas like SUM to simplify calculations.
Ip Networking Over Satelite Course SamplerJim Jenkins
This three-day course is designed for satellite engineers and managers in government and industry who need to increase their understanding of the Internet and how Internet Protocols (IP) can be used to transmit data and voice over satellites. IP has become the worldwide standard for data communications. Satellites extend the reach of the Internet and Intranets. Satellites deliver multicast content efficiently anywhere in the world. With these benefits come challenges. Satellite delay and bit errors can impact performance. Satellite links must be integrated with terrestrial networks. Space segment is expensive; there are routing and security issues. This course explains the techniques and architectures used to mitigate these challenges. Quantitative techniques for understanding throughput and response time are presented. System diagrams describe the satellite/terrestrial interface. The course notes provide an up-to-date reference. An extensive bibliography is supplied.
Introduction to Processing and creative codingJerome Herr
This document provides a visual overview of creative coding and graphic design techniques using code. It includes examples of static and animated graphics using processing, as well as motion graphics, data visualization, collages, photo manipulation, and 3D graphics. Basic code examples are provided for creating static and animated graphics. Additional resources include links to online tutorials and books about creative coding.
This document lists various Windows command line utilities, organized alphabetically. Some of the more common commands listed include COPY, DATE, DEL, DIR, ECHO, MD, MKDIR, MOVE, PATH, REN, RD, SET, START, TIME, TITLE, TYPE, VER, and XCOPY. The commands allow users to manage files, folders, disks, environment variables, and perform other tasks from the command line.
This document provides an overview of programmable logic controllers (PLCs). It discusses the history of PLCs, how they were developed to replace relay-based control systems. The key components of a PLC including the processor, memory, and input/output modules are described. Examples of PLC programming languages and applications in industrial automation like machine control, food/beverage processing, and material handling are provided. Advantages of PLCs include fast operation, modularity, ease of maintenance, and improved productivity. Disadvantages include initial high costs and difficulty changing or replacing systems. PLCs have become widely used in industrial automation applications ranging from simple to complex control systems.
A Complete Guide to “useradd” Command in Linux with Examples _ HostbilloKiyanaSharma1
The document provides a complete guide to using the "useradd" command in Linux to add new user accounts. It covers the basic syntax of the useradd command and various options such as -m to create a home directory, -u to specify a user ID, -g to assign a primary group, and -G to assign secondary groups. The document also discusses how to set expiration dates, comments, login shells, and passwords for new users. Examples are given for each configuration.
This document provides information on user administration in Solaris, including:
- The system files used to store user account information like /etc/passwd, /etc/shadow, and /etc/group.
- Commands for managing user accounts like useradd, usermod, userdel, passwd, and su.
- Configuring password policies using /etc/default/passwd and locking accounts after failed login attempts.
- Managing groups using groupadd, groupmod, and groupdel.
- Variables that customize a user's session and setting them.
- Commands to monitor system access like who, finger, last, and recording failed login attempts.
Linux is an open-source operating system that can be used as a server or standalone OS. It offers advantages like stability, robustness, security, and high performance. Linux directories include / for the root directory, /bin for essential programs, /home for user files, and /var for variable data. Common Linux commands include ls to list files, cd to change directories, grep to search files, and vi/emacs for text editing. Cron jobs allow scheduling commands to run periodically using a crontab file.
This document provides an overview of a presentation on Linux programming and administration. It covers the history of Unix and Linux, files and directories in Linux, Linux installation, basic Linux commands, user and group administration, and LILO (Linux Loader). The document introduces key topics like Unix flavors, Linux distributions, partitioning and formatting disks for Linux installation, the file system hierarchy standard, and access permissions in Linux.
This document provides an overview of user and group administration in Linux. It discusses the different types of users (super user, system user, normal user) and explains how to create, modify, lock, unlock and delete users. It also covers groups, including how to create, modify and manage group membership by adding or removing users to groups. The key files for user (/etc/passwd and /etc/shadow) and group (/etc/group) configuration are also explained.
The document discusses Unix system accounts and account management. It covers the following key points:
- There are two types of user accounts: root (superuser) and normal users. Root has full access and control over the system.
- Files like /etc/passwd, /etc/shadow, and /etc/group are used to store user, password, and group information. Commands like useradd, userdel, and groupadd are used to manage accounts.
- Groups allow grouping of users to facilitate sharing of files/directories. The group file, /etc/group, associates users with groups. Permissions can be set to allow group access/modification of files.
Workspace Control Environment Variablesmarcelvenema
This document discusses environment variables in Ivanti Workspace Control. It provides information on:
- Setting environment variables based on identity, location, devices, date/time, and workspace containers.
- Setting environment variables globally or at the application level via composition.
- Common environment variables like %username%, %computername%, and custom variables like %fileserver%.
- Functions for manipulating environment variable values like $substring() and $uppercase().
- Best practices like using administrative notes and watching execution order when variables reference other variables.
This document provides information on managing users and groups in Linux. It lists commands for adding, modifying, and deleting users and groups such as useradd, usermod, userdel, and groupadd. It describes how user information is stored in files like /etc/passwd, /etc/shadow, and /etc/group. It also covers setting passwords, restricting login access, giving users root privileges, and managing secondary groups. Potential error scenarios involving permissions and viewing passwords are also addressed.
Linux is an open-source operating system designed as a free alternative to Unix, with a reputation for efficiency and performance; it was developed by Linus Torvalds in 1991 and is now developed collaboratively under the GNU license. The document also provides descriptions of common Linux commands like pwd, cd, ls, and examples of how to use them.
Server is a machine configured to accept requests from clients and respond accordingly. Linux is commonly used for servers, with distributions like Ubuntu, Redhat, and Debian. Key principles of Linux include treating everything as a file, storing configuration data in text files, and using pipes to connect programs. Common server files include /etc/group, /etc/passwd, and /etc/shadow which contain user and group information.
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesSeth Miller
Database Administrators running databases on Linux spend a vast majority of their time in the command line interface. Changing environment settings, moving through directories, typing out and executing lengthy commands, and manipulating files requires valuable keystrokes and time. The rule of thumb for an efficient DBA should be that any command executed more than once per day should be reduced to four characters or less. This presentation reviews techniques to dramatically reduce the amount of time Database Administrators spend typing commands by using shell features and scripting to do the work for them.
1. The document discusses various topics related to Unix-style operating systems including versions, user and group settings, file permissions, local firewall configuration, security policies, and tools.
2. It provides details on password files, restricting access for default users and groups, setting file permissions, and disabling unnecessary network services.
3. The document also outlines recommendations for configuring a local firewall like UFW, implementing security policies for passwords, accounts, and more.
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
The document provides an introduction to using the Linux command line for bioinformatics tasks. It covers navigating the file system, manipulating files and directories, input/output redirection, piping commands together, and commonly used text processing tools. The goal is to help users easily use command line tools, automate repetitive tasks, and parse/summarize text-based outputs.
This document discusses access control lists (ACLs) and how they are implemented across different platforms and file systems. It provides a history of ACL implementations including POSIX ACLs, NTFS ACLs, and NFSv4 ACLs. It also discusses specifics of how ACLs are supported and some issues that can arise with ACLs on the author's NetApp and FreeBSD environments. Overall, the document aims to educate about ACL standards and interoperability challenges across platforms.
This document discusses using Ansible and AWS to automate infrastructure provisioning and management. It describes challenges around sharing patient data across clinics and outlines how Ansible addresses issues of scale, security, maintenance and knowledge sharing through infrastructure as code, source control and audit trails. Key Ansible concepts are also summarized such as modules, tasks, plays, playbooks, templates, inventory, handlers, plugins and facts.
Linux is a free, open-source operating system that provides functionality similar to Unix systems. The document then lists and describes several common Linux commands used to navigate directories, view files and system information, manage processes, and edit text files. It also includes a diagram of the standard Linux directory structure and brief descriptions of the purpose of each top-level directory.
Coming from UNIX System V (IBM AIX & Sun Solaris) System Programmer background, I find Linux has become the defacto choice for many computing workload, from embedded device, mobile phone, mission critical systems, all the way to the largest Super Computer Cluster in the world.
While Linux has tried to maintain its UNIX design philosophy, its foundation has radically changed departing its UNIX root (bye init, hi systemd), towards modern Operating Systems which many of its features have equivalent of its UNIX counterparts - if not better (Linux Container vs AIX WPAR/Solaris Zones, Solaris ZFS vs Stratis, and many more).
This document is not meant to beat Red Hat comprehensive online manual, instead it was written to help me memorize many of advanced RHEL features and to help me pass hands on performance based EX200 exam.
This document is compiled from many sources, and written for anyone who would like to learn Red Hat Enterprise Linux 8, through taking EX200 exam in order to showing off RHCSA title to your friend :D
Happy Learning and may the force be with you!
This document provides an overview of the basics of Linux, including Linux distributions, components other than the kernel, popular distributions, getting connected via command line and SSH, common directories, the shell, command line vs GUI, basic commands, file permissions, and copying/moving files. It discusses key topics like the Linux kernel, distributions, directories, shells, commands, permissions, and file operations.
This document summarizes the server configuration and Active Directory setup at a school. It describes the primary and secondary ESXi servers that run domain controllers, file servers, backup servers, and terminal servers. It explains how the domain controllers manage computers and users across different domains, including the staff1, student1, and root ocaat1 domains. It provides instructions for adding user accounts, setting up group policies, configuring the DHCP and DNS servers, and establishing file sharing permissions.
Sudo allows a user to run commands as the superuser or another user with certain permissions. It is commonly used when a user needs elevated privileges for a specific task without logging in as the root user. The sudoers file defines which commands can be run with sudo for each user or group. To use sudo, a user must be granted permission via the sudoers file and enter their own password when prompted, unless the timestamp is still valid within the timeout period.
Windows 7 provides many useful tricks and tweaks to help users get the most out of the operating system. This document outlines 22 tips, including how to take screenshots of error messages to email for troubleshooting help, burn ISO images, mount and create virtual hard drives, and access a "God Mode" folder to view all Control Panel options in one place. The tips cover a wide range of topics from power management and printing to application troubleshooting and customizing the desktop experience.
Dokumen tersebut berisi petunjuk soal ujian praktik kejuruan tentang instalasi sistem operasi Debian, konfigurasi DNS server, mail server dan webmail server."
Proses pembuatan processor chip sangat kompleks dan terdiri dari ratusan tahapan. Dimulai dari pengolahan pasir menjadi silikon murni, pembuatan wafer dari silikon, pencetakan sirkuit di wafer melalui fotolitografi, hingga pengujian dan pengemasan akhir. Proses ini melibatkan teknologi tingkat lanjut untuk mencetak sirkuit nano di dalam chip komputer.
Panduan instalasi clear os 5.2 standalone mode, web server, ftp serverSubuh Kurniawan
Dokumen tersebut memberikan panduan lengkap untuk melakukan instalasi dan konfigurasi sistem operasi server ClearOS versi 5.2 dalam mode standalone. Langkah-langkahnya meliputi persiapan hardware, instalasi sistem operasi, konfigurasi jaringan dan berbagai layanan server seperti FTP, web server, database MySQL, serta cara berbagi file menggunakan fitur Flexshare.
2. ADDUSERS.exe an account with the same SID.
Automate the creation of a large number of users This option will not erase built-in accounts.
Syntax
Create Users: Password_options
AddUsers /c filename [/s:x] [/?] Domain /p: - Set account creation options, used along with
Password_options any combination of the following:
Dump to file: * l - Users do not have to change passwords at next
AddUsers /d{:u} filename [/s:x] [/?] Domain logon.
Password_options * c - Users cannot change passwords.
Erase Users: * e - Passwords never expire. (implies l option)
AddUsers /e filename [/s:x] [/?] Domain * d - Accounts disabled.
Password_options By default, all created users are required to
key change their password at logon.
Example
Filename - The comma-delimited file that AddUsers uses for Create a comma-delimited text file, which contains the new users to be created. Following the
data. Syntax as follows:
[Users]
/s:x - Change the delimiter character used in filename User Name,Full name, Password, Description, HomeDrive, Homepath, Profile, Script
to x. e.g.
e.g. /s:~ would make the [User]
delimiter "~" jimmye,James Edward Phillip II,,,,,,
alexd,Alex Denuur,,,E:,E:usersalexd,,
Domain - Query the Primary Domain Controller (PDC) of ronj,Ron Jarook,ChangeThis,,E:,E:usersronj,,
domain. sarahs,Sarah Smith,,,,,,
You can also use Servername to specify the u0123,Mike Olarte,,,,,,
machine where user accounts are created or read. Save the file as C:Users.txt and execute the command
AddUsers will use the local computer by default AddUsers MyDomain /c c:Users.txt /p:e
(if you do not specify Domain)
/c - Create user accounts, local groups, and global
ARP.exe
ARP - Address Resolution Protocol
groups as specified by filename.
Display and modify the IP-to-Physical address translation tables used by address resolution
/d{:u} - Dump user accounts, local groups, and global
protocol.
groups to filename.
Syntax
The (:u) is an optional switch that causes current accounts to be written to the specified file in View the contents of the local ARP cache table
Unicode text format. Choosing to dump current user accounts does not save the account's ARP -a [ip_addr] [-N if_addr]
passwords or any security information for the accounts.
Note: Password information is not saved in a user account dump and if you use the same file to Add a static Arp entry for frequent accessed hosts
create accounts, all passwords of newly created accounts will be empty. To back up security ARP -s ip_addr eth_addr [if_addr]
information for accounts, use a Tape Backup.
/e - Erase the user accounts specified in the file Delete an entry
name. ARP -d ip_addr [if_addr]
CAUTION: Be careful when erasing user accounts,
as it is not possible to recreate
Windows Command Prompt www.nubielab.com Page 2
3. Key Syntax
-a Display current ARP entries. ASSOC .ext = [fileType]
May include more than one network interface. ASSOC
If ip_addr is specified, the IP and Physical ASSOC .ext
addresses for only the specified computer are ASSOC .ext =
displayed.
-g Same as -a. Key
.ext : The file extension
-N if_addr Display the ARP entries for the network fileType : The type of file
interface specified A file extension is the last few characters in a FileName after the period.
by if_addr. So a file called JANUARY.HTML has the file extension .HTML
-d ip_addr Delete the host specified by ip_addr. The File extension is used by Windows NT to determine the type of information stored in the file
-d * will delete all hosts. and therefore which application(s) will be able to display the information in the file. File
extensions are not case sensitive and are not limited to 3 characters.
-s Add the host and associates the Internet address
ip_addr More than one file extension may be associated with the same File Type.
with the Physical address eth_addr. The e.g. both the extension .JPG and the extension .JPEG may be associated with the File Type
Physical address is "jpegfile"
given as 6 hexadecimal bytes separated by
hyphens. The entry At any one time a given file extension may only be associated with one File Type.
is permanent. e.g. If you change the extension .JPG so it is associated with the File Type "txtfile" then it's
normal association with "jpegfile" will disappear. Removing the association to "txtfile" does not
eth_addr Specifies a physical address. restore the association to "jpegfile"
if_addr If present, this specifies the Internet address File Types can be displayed in the Windows Explorer GUI: [View, Options, File Types]
of the however the spelling is usually different to that expected by the ASSOC command e.g. the File
interface whose address translation table should Type "txtfile" is displayed in the GUI as "Text Document"and "jpegfile" is displayed as
be modified. "image/jpeg"
If not present, the first applicable interface
will be used. The command ASSOC followed by just a file extension will display the current File Type for
If two hosts on the same sub-net cannot ping each other successfully, try running ARP -a to list that extension.
the addresses on each computer to see if they have the correct MAC addresses.
A host's MAC address can be checked using IPCONFIG. If another host with a duplicate IP ASSOC without any parameters will display all the current file associations.
address exists on the network, the ARP cache may have had the MAC address for the other
computer placed in it. ARP -d is used to delete an entry that may be incorrect. ASSOC with ".ext=" will delete the association for that file extension.
Examples Did you leave the Always Use This Program To Open This File option turned on?
Display the ARP cache tables for all interfaces: To change it back so it prompts you to specify a program each time, just delete the association
C:> arp -a for that file type
Display the ARP cache table for the interface on IP address 10.1.4.99: ASSOC .ext=
C:> arp -a -N 10.1.4.99 [where .ext is the file extension].
Add a static ARP cache entry on IP addr 10.1.4.77 to the physical address 00-AA-21-4A-2F-9A: Now when you double-click on a file of that type, the system will ask you what program you
C:> arp -s 10.1.4.77 00-AA-21-4A-2F-9A want to use.
ASSOC
Display or change the association between a file extension and a fileType Using the ASSOC command will edit values stored in the registry at HKey_Classes_Root.<file
Windows Command Prompt www.nubielab.com Page 3
4. extension> /q : Quiet - Suppress interactive prompts.
Therefore it's possible to use registry permissions to protect a file extension and prevent any file /f : Force - Force overwrite or delete without
association changes. questions.
/d : Delete - Delete the association.
Examples: A file extension is the last few characters in a FileName after the period.
So a file called JANUARY.HTML has the file extension .HTML
Viewing file associations:
The File extension is used by Windows NT to determine the type of information stored in the file
ASSOC .txt and therefore which application(s) will be able to display the information in the file. File
ASSOC .doc extensions are not case sensitive and are not limited to 3 characters.
ASSOC >backup.txt
Example: adding a File Association
Editing file associations:
To add the File Type "SQLfile"=Notepad.exe and also set the File Association of
ASSOC .txt=txtfile .SQL="SQLfile" run this command:
ASSOC .DIC=txtfile
ASSOC .html=Htmlfile ASSOCIATE .SQL Notepad.exe
Deleting a file association: Example: Removing a File Association
ASSOC .html= ASSOCIATE .SQL /d
Repair .REG and .EXE file associations:
ASSOC .EXE=exefile Note that /d will delete the File Association but will NOT delete the File Type.
ASSOC .REG=regfile
Digging through CLASSES_ROOT entries often reveals more than one shell for the same File types created by Associate.exe are always given a name in the form xxxfile, where xxx is
application, for example the Apple Quick Time player has two entries, one to "open" (which the file extension.
gives an annoying nag screen) and one to just "play" the QT file: ATTRIB.exe
[HKEY_CLASSES_ROOTMOVFileshellopen] and [play] Display or change file attributes. Find Filenames.
In cases like this you can change the default action e.g. Syntax
[HKEY_CLASSES_ROOTMOVFileshell] ATTRIB [ + attribute | - attribute ] [pathname] [/S [/D]]
@="play"
Key
+ : Turn an attribute ON
ASSOCIATE.exe (Resource Kit) - : Clear an attribute OFF
One step file association.
pathname : Drive and/or filename e.g. C:*.txt
This utility does the job of both ASSOC and FTYPE, in one step. ASSOCIATE assigns an /S : Search the pathname including all subfolders.
extension directly with an executable application. This is done by automatically adding a new /D : Process folders as well
FileType to the system registry.
Syntax attributes:
ASSOCIATE .ext filename [/q /d /f]
R Read-only (1)
Key H Hidden (2)
.ext : Extension to be associated. A Archive (32)
filename : Executable program to associate .ext with. S System (4)
Windows Command Prompt www.nubielab.com Page 4
5. because Windows Explorer will be forced to request the Desktop.ini of every sub-folder to see if
extended attributes: any special folder settings need to be set.
E Encrypted
C Compressed (128:read-only) Viewing archive attributes
I Not content-indexed
L Symbolic link/Junction (64:read-only) The Archive attribute (A) is used to mark files that have changed since they were previously
N Normal (0: cannot be used for file selection) backed up. The (A) flag is automatically updated by Windows as the file is saved.
O Offline
P Sparse file If the (A) flag is present - the file is new or has been changed since the last backup.
T Temporary
The numeric values may be used when changing attributes with VBS/WSH The MSBACKUP, RESTORE, and XCOPY commands use these Archive attributes, as do many
If no attribute is specified attrib will return the current attribute settings. Used with just the /S (but not all) 3rd party backup solutions.
option ATTRIB will quickly search for a particular filename. Constants - the following attribute values are returned by the GetFileAttributes function:
FILE_ATTRIBUTE_READONLY = 1
Hidden and System attributes take priority. FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_SYSTEM = 4
If a file has both the Hidden and System attributes set, you can clear both attributes only with a FILE_ATTRIBUTE_DIRECTORY = 16
single ATTRIB command. FILE_ATTRIBUTE_ARCHIVE = 32
FILE_ATTRIBUTE_ENCRYPTED = 64
For example, to clear the Hidden and System attributes for the RECORD.TXT file, you would FILE_ATTRIBUTE_NORMAL = 128
type: FILE_ATTRIBUTE_TEMPORARY = 256
ATTRIB -S -H RECORD.TXT FILE_ATTRIBUTE_SPARSE_FILE = 512
FILE_ATTRIBUTE_REPARSE_POINT = 1024
File Attributes FILE_ATTRIBUTE_COMPRESSED = 2048
FILE_ATTRIBUTE_OFFLINE = 4096
You can use wildcards (? and *) with the filename parameter to display or change the attributes FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
for a group of files.
BCDBOOT.exe (Windows 7 /2008)
Remember that, if a file has the System or Hidden attribute set, you must clear that attribute Set up a system partition, repair the boot environment located on the system partition.
before you can change any other attributes. Syntax
BCDBOOT source [/l locale] [/s volume-letter]
Directory Attributes [/v] [/m [{OS Loader GUID}]]
You can display or change the attributes for a directory/folder. To use ATTRIB with a directory, Options
you must explicitly specify the directory name; you cannot use wildcards to work with
directories. source The location of the Windows directory to use as the
For example, to hide the directory C:SECRET, you would type the following: source for
copying boot-environment files.
ATTRIB +H C:SECRET
/l The locale. default = US English.
The following command would affect only files, not directories: ATTRIB +H C:*.*
The Read-only attribute for a folder is generally ignored by applications, however the Read-only /s The volume letter of the system partition.
and System attributes are used by Windows Explorer to determine whether the folder is a special The default is the system partition identified by the
folder, such as My Documents, Favorites, Fonts, etc. firmware.
Setting the Read-Only attribute on a folder can affect performance, particularly on shared drives
Windows Command Prompt www.nubielab.com Page 5
6. /v Enable verbose mode BOOTCFG /raw Add OS load options, specified as a
string
/m By default, merge only global objects.
If an OS Loader GUID is specified, merge the given BOOTCFG /rebuild Totally rebuild boot.ini (use when
loader object within Windows won't start)
the system template to produce a bootable entry.
BCDboot may also be run from Windows PE (Preinstallation Environment) BOOTCFG /rmsw Remove OS load options for an OS
Examples
Initialize the system partition using files from the operating system image installed on the C: BOOTCFG /timeout Change the OS time-out value.
volume: Detailed options for all the above are available from BOOTCFG /? Items in bold are only
C:> bcdboot C:Windows available from the recovery console
Set the default BCD locale to Japanese, and copy BCD (Boot Configuration Data) files to drive Default identification strings:
S: OS Load Options = /Fastdetect
C:> bcdboot C:Windows /l ja-jp /s S: Load Identifier = Microsoft Windows XP Professional
Merge the OS loader in the current BCD store identified with the given GUID in the new BCD If you intend to rebuild the boot.ini file, delete it first - boot into the recovery console then:
store: ATTRIB -H -R -S C:Boot.ini
C:> bcdboot c:windows /m {d58d10c6-df53-11dc-878f-00064f4f4e08} DEL C:Boot.ini
Bootcfg /Rebuild
BOOTCFG.exe Fixboot
Edit the Windows boot settings stored in Boot.ini
Syntax CACLS.exe
BOOTCFG /addsw Add OS load options for an OS entry in Display or modify Access Control Lists (ACLs) for files and folders.
boot.ini
Access Control Lists apply only to files stored on an NTFS formatted drive, each ACL
BOOTCFG /copy Duplicate the entries for an OS determines which users (or groups of users) can read or edit the file. When a new file is created it
instance. normally inherits ACL's from the folder where it was created.
Syntax
BOOTCFG /dbg1394 Configure 1394 port debugging CACLS pathname [options]
BOOTCFG /debug Edit the debug settings for an OS. Options:
BOOTCFG /default Specify the default OS /T Search the pathname including all subfolders.
/E Edit ACL (leave existing rights unchanged)
BOOTCFG /delete Delete an OS entry [operating systems] /C Continue on access denied errors.
section of Boot.ini
/G user:permission
BOOTCFG /ems Redirect the EMS console to a remote Grant access rights, permision can be:
computer (server only). R Read
(Emergency Management Services) W Write
C Change (read/write)
BOOTCFG /list List entries in boot.ini F Full control
BOOTCFG /query Display section entries from Boot.ini /R user
Windows Command Prompt www.nubielab.com Page 6
7. Revoke specified user's access rights (only valid with /E /R to remove ACL rights for the user concerned, then use /E to add the desired
/E). rights.
The /T option will only traverse subfolders below the current directory.
/P user:permission If no options are specified CACLS will display the current ACLs
Replace access rights, permission can be: e.g. To display the current folder
N None CACLS .
R Read Display permissions for one file
W Write CACLS MyFile.txt
C Change (read/write) Display permissions for multiple files
F Full control CACLS *.txt
/D user Inherited folder permissions are displayed as:
Deny access to user. OI - Object inherit - This folder and files. (no inheritance
In all the options above "user" can be a UserName or a Workgroup (either local or global) to subfolders)
CI - Container inherit - This folder and subfolders.
You can specify more than one user:permission in a single command. Wildcards can be used to IO - Inherit only - The ACE does not apply to the current
specify multiple files. file/directory
If a UserName or WGname includes spaces then it must be surrounded with quotes e.g.
"Authenticated Users" These can be combined as folllows:
(OI)(CI) This folder, subfolders, and files.
If no options are specified CACLS will display the ACLs for the file(s) (OI)(CI)(IO) Subfolders and files only.
Setting Deny permission (/D) will deny access to a user even if they also belong to a group that (CI)(IO) Subfolders only.
grants access. (OI) (IO) Files only.
Limitations So BUILTINAdministrators:(OI)(CI)F means that both files and Subdirectories will inherit 'F'
Cacls cannot display or modify the ACL state of files locked in exclusive use. (Fullcontrol)
Cacls cannot set the following permissions: change permissions, take ownership, execute, delete similarly (CI)R means Directories will inherit 'R' (Read folders only = List permission)
use XCACLS to set any of these. To actually change the inheritance of a folder/directory use iCACLS /grant or iCACLs /deny
When cacls is applied to the current folder only there is no inheritance and so no output.
Using CACLS Errors when changing permissions
The CACLS command does not provide a /Y switch to automatically answer 'Y' to the If a user or group has a permission on a file or folder and you grant a second permission to the
Y/N prompt. However, you can pipe the 'Y' character into the CACLS command using same user/group on the same folder, NTFS will sometimes produce the error message "The
ECHO, use the following syntax: parameter is incorrect" To fix this (or prevent it happening) revoke the permission first (/e /r) and
then reapply (/e /g)
ECHO Y| CACLS /g <username>:<permission> Examples:
Add Read-Only permission to a single file
To edit a file you must have the "Change" ACL (or be the file's owner) CACLS myfile.txt /E /G "Power Users":R
To use the CACLS command and change an ACL requires "FULL Control" Add Full Control permission to a second group of users
File "Ownership" will always override all ACL's - you always have Full Control over files CACLS myfile.txt /E /G "FinanceUsers":F
that you create. Now revoke the Read permissions from the first group
CACLS myfile.txt /E /R "Power Users"
If CACLS is used without the /E switch all existing rights on [pathname] will be
replaced, any attempt to use the /E switch to change a [user:permission] that already Now give the first group Full-control:
exists will raise an error. To be sure the CALCS command will work without errors use CACLS myfile.txt /E /G "Power Users":F
Windows Command Prompt www.nubielab.com Page 7
8. Give the Finance group Full Control of a folder and all sub folders At the end of the subroutine, GOTO :eof will return to the position where you used CALL.
CACLS c:docswork /E /T /C /G "FinanceUsers":F
Example
@ECHO OFF
CALL SETLOCAL
Call one batch program from another. CALL :s_staff SMITH 100
Syntax GOTO s_last_bit
CALL [drive:][path]filename [parameters]
:s_staff
CALL :label [parameters] ECHO Name is %1
ECHO Rate is %2
CALL internal_cmd GOTO :eof
Key: :s_last_bit
pathname The batch program to run ECHO The end of the script
Advanced usage : CALLing internal commands
parameters Any command-line arguments
In addition to the above, CALL can also be used to run any internal command (SET, ECHO etc)
:label Jump to a label in the current batch script.
and also expand any environment variables passed on the same line.
internal_cmd Any internal command, first expanding any
For example
variables in the argument
@ECHO off
CALL a second batch file SETLOCAL
The CALL command will launch a new batch file context along with any specified arguments. set server1=frodo3
When the end of the second batch file is reached (or if EXIT is used), control will return to just set server2=gandalf4
after the initial CALL statement. set server3=ascom5
CALL a subroutine (:label) set server4=last1
The CALL command will pass control to the statement after the label specified along with any
specified arguments . ::run the Loop for each of the servers
To exit the subroutine specify GOTO:eof this will transfer control to the end of the current call :loop server1
subroutine. call :loop server2
Arguments can be passed either as a simple string or using a variable: call :loop server3
CALL MyScript.cmd "1234" call :loop server4
CALL OtherScript.cmd %_MyVariable% goto:eof
Use a label to CALL a subroutine :loop
set _var=%1
A label is defined by a single colon followed by a name. This is the basis of a batch file function. :: Evaluate the server name
CALL :s_display_result 123 CALL SET _result=%%%_var%%%
ECHO Done echo The server name is %_result%
GOTO :eof goto :eof
:s_display_result
ECHO The result is %1 :s_next_bit
GOTO :eof :: continue below
Windows Command Prompt www.nubielab.com Page 8
9. :: Note the line shown in bold has three '%' symbols Moving down the folder tree with a reference RELATIVE to the
:: The CALL will expand this to: SET _result=%server1% current folder...
Each CALL does one substitution of the variables. (You can also do CALL CALL... for multiple C:windows> CD java
substitutions) C:windowsjava>
If you CALL an executable or resource kit utility make sure it's available on the machine where
the batch will be running, also check you have the latest versions of any resource kit utilities. Moving up and down the folder tree in one command...
If Command Extensions are disabled, the CALL command will not accept batch labels. C:windowsjava> CD ..system32
C:windowssystem32>
If Command Extensions are enabled the CD command is enhanced as follows:
CD
Change Directory - Select a Folder (and drive) 1) The current directory string is converted to use the correct CASE.
Syntax So CD C:wiNnt would actually set the current directory to C:Winnt
CD [/D] [drive:][path]
CD [..] 2) CD does not treat spaces as delimiters, so it is possible to CD into a subfolder name that
contains a space without surrounding the name with quotes.
Key
/D : change the current DRIVE in addition to changing folder. For example:
Examples cd My folder
To change to the parent directory.
C:Work> CD .. is the same as:
cd "My folder"
To change to the grant-parent directory. 3) An asterisk can be used to complete a folder name
C:WorkbackupJanuary> CD .... e.g. from C:
To change to the ROOT directory. C:> CD pro*
C:WorkbackupJanuary> CD will move to
C:Program Files
To display the current directory in the specified drive.
C:> CD D: CHDIR is a synonym for CD
To display the current drive and directory. Tab Completion
C:Work> CD
This allows changing current folder by entering part of the path and pressing TAB
To display the current drive and directory. C:> CD Prog [PRESS TAB]
C:Work> ECHO "%CD%" Will go to C:Program Files
Tab Completion is disabled by default, it has been known to create difficulty when using a batch
In a batch file to display the location of the batch script script to process text files that contain TAB characters.
file (%0)
C:> ECHO "%~dp0" Tab Completion is turned on by setting the registry value shown below
Moving down the folder tree with a full path reference to the REGEDIT4
ROOT folder... [HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor]
C:windows> CD windowsjava "CompletionChar"=dword:00000009
C:windowsjava> Changing the Current drive
Windows Command Prompt www.nubielab.com Page 9
10. simply enter the drive letter followed by a colon Example:
C:> E:
E:> CHKDSK C: /F
Fixing Errors /F
To change drive and directory at the same time, use CD with the /D switch
C:> cd /D E:utils If the drive is the boot partition, you will be prompted to run the check during the next boot
E:utils>
If you specify the /f switch, chkdsk will show an error if open files are found on the disk.
Chkdsk /f will lock the volume, making data unavailable until chkdsk is finished.
chkdsk.exe If you use chkdsk /f on a disk with a very large number of files (millions), chkdsk may take a
Check Disk - check and repair disk problems long time to complete.
Syntax
When you delete a file or folder that has 'custom' permissions, the ACL is not deleted, it is
CHKDSK [drive:][[path]filename] [/F] [/V] [/R] [/L[:size]]
cached. Chkdsk /f will remove ACLs that are no longer used. This is often the cause of the rather
worrying message: "Windows found problems with the file system. Run chkdsk with the /F (fix)
Key
option to correct these."
[drive:] The drive to check.
It is normal for chkdsk /F to remove unused index entries and unused security descriptors every
time you run it, these do not indicate a problem with the file system.
filename File(s) to check for fragmentation (FAT only).
/F Automatically Fix file system errors on the disk. Scan only (without /f switch)
/X Fix file system errors on the disk, (Win2003 and If a file needs to be fixed chkdsk will alert you with a message but will not fix the error(s).
above)
dismounts the volume first, closing all open file chkdsk may report lost allocation units on the disk - it will produce this report even if the files
handles. are in-use (open). If corruption is found, consider closing all files and repairing the disk with /F.
Running chkdsk on a data volume that is in use by another program or process may incorrectly
/R Scan for and attempt Recovery of bad sectors. report errors when none are present. To avoid this, close all programs or processes that have
open handles to the volume.
/V Display the full path and name of every file on On computers running Windows 2003 SP1, chkdsk automatically creates a shadow copy, so you
the disk. can check volumes that are 'in use' by another program or process. This enables an accurate
report against a live file server. On earlier versions of Windows, chkdsk would always lock the
/L:size NTFS only: change the log file size to the volume, making data unavailable.
specified number of kilobytes. Run at Bootup
If size is not specified, displays the current log Running at bootup is often the easiest way to close all open file handles.
size and the drive type Use the GUI, chkntfs or the FSUTIL dirty commands to set or query the volumes 'dirty' bit so
(FAT or NTFS). that Windows will run chkdsk when the computer is restarted.
Event Logs
/C Skip directory corruption checks. Chkdsk will log error messages in the Event Viewer - System Log.
Chkdsk /f removes ACLs that are no longer used and reports this in the Event Viewer -
/I Skip corruption checks that compare directory Application Log.
entries to the Cluster (or block) Size
file record segment (FRS) in the volume's master
file table (MFT) CHKDSK produces a report that shows the the block /cluster size
typically: "4096 bytes in each allocation unit."
Windows Command Prompt www.nubielab.com Page 10
11. When the cluster size is greater than 4 KB on an NTFS volume, none of the NTFS compression
functions are available. /T : Change the Autochk.exe initiation countdown time (time
Exit codes in seconds)
If you don't specify Time: displays the current
0 No errors were found countdown time.
1 Errors were found and fixed.
2 Could not check the disk, did not or could not fix errors. /D : Restore the machine to the default behavior; all drives
Notes: are
Consider the time required to run Chkdsk to repair any errors that occur. Chkdsk times are checked at boot time and chkdsk is run on those that are
determined by the number of files on the volume and by the number of files in the largest folder. dirty.
Chkdsk performance under Windows 2003 is around 30% faster than previous versions. This undoes the effect of the /X option.
If no switches are specified, CHKNTFS will display the status of the dirty bit for each drive.
To issue chkdsk on a hard drive you must be a member of the Administrators group. /T option is new in Win XP
When CHKDSK is set to run at boot-up there is a delay to allow the check to be cancelled - this
can be configured in the registry:
HKLMSystemCurrentControlSetControlSession Manager
REG_DWORD:AutoChkTimeOutData CHOICE.exe (Resource Kit/Standard Vista command)
The value is the time in seconds that you want CHKDSK to wait (0 = no delay) default is 10 Accept user input to a batch file.
seconds.
Chkdsk is also available from the Recovery Console (with different parameters.) Choice allows single key-presses to be captured from the keyboard.
Disk Errors Syntax
"The file system structure on the disk is corrupt and unusable" CHOICE [/C[:]choiceKeys] [/N] [/S] [/T[:]k,nn] [text]
If you have disk corruption, run the drive manufacturers diagnostics:
Toshiba | Hitachi | ibm | Seagate/Maxtor/Freeagent | Western digital Key
/C[:]choiceKeys : One or more keys the user can press.
Default is YN
CHKNTFS.exe /N : Do not display choiceKeys at end of prompt
Check the NTFS file system with CHKDSK string.
Syntax /S : case Sensitive.
CHKNTFS drive: [...] /T[:]k,dd : Default the choice to k after dd seconds
CHKNTFS /C drive: [...] text : Message string to display the choices
CHKNTFS /X drive: [...] available
CHKNTFS /t[:Time]
CHKNTFS /D The Windows 2003 version has some slight differences:
Key CHOICE [/c [choiceKeys]] [/N] [/CS] [/t Timeout /d Choice]
drive : Specifies a drive letter. [/m Text]
/C : Check - schedules chkdsk to be run at the next reboot. key
/C[:]choiceKeys : One or more keys the user can press.
/X : Exclude a drive from the default boot-time check. Default is YN
Excluded drives are not accumulated between command /N : Do not display choiceKeys at end of prompt
invocations. string.
Windows Command Prompt www.nubielab.com Page 11
12. /CS : Case Sensitive. If UserName is not supplied, it will be
/T dd : Timeout in dd seconds requested.
/d choiceKey : Choice made on Timeout
/m text : Message string to describe the choices /pass:Password The password to store with this entry. If
available Password is not supplied, it will be requested.
ERRORLEVEL will return the numerical offset of choiceKeys. /delete: Delete a user name and password from the
Availability list.
Choice.com was originally supplied on the Windows 95 install CD, however there are some If TargetName is specified, that entry will
issues with this version under NT - multiple concurrent invocations of CHOICE will clobber be deleted.
each other. CHOICE.com will also burn a lot of CPU's when in a wait state. If /ras is specified, the stored remote
The NT and 2000 Resource Kits contain CHOICE.EXE which behaves a lot better. access entry will be deleted.
In Windows 2003 CHOICE became a built-in command so it is no longer in the resource kit.
Examples: /list Display the list of stored user names and
credentials.
CHOICE /C:FH /M select [F] Floppy or [H] Hard drive If TargetName is not specified, all stored
IF errorlevel 2 goto s_hard user names and credentials will be listed.
IF errorlevel 1 goto s_floppy If more than one smart card is found, cmdkey will prompt the user to specify which one to use.
Once stored, passwords are not displayed.
Note the order of the IF statements above, IF errorlevel 1 will return TRUE for an errorlevel of 2
Examples:
CHOICE can be used to set a specific %errorlevel%
for example to set the %errorlevel% to 6 : Display a list of stored user names and credentials:
ECHO 6| CHOICE /C:123456 /N >NUL cmdkey /list
CMDKEY.exe (Windows 7) Add a user name and password for user Kate to access computer Server01 with the password
Create, list or delete stored user names, passwords or credentials. passme, type:
Syntax cmdkey /add:server01 /user:Kate /pass:passme
cmdkey [{/add:TargetName|/generic:TargetName}] Add a user name for user Kate to access computer Server01 and prompt for the password
{/smartcard|/user:UserName [/pass:Password]} whenever Server01 is accessed:
[/delete{:TargetName|/ras}] cmdkey /add:server01 /user:Kate
/list:TargetName Delete the stored credential for remote access:
cmdkey /delete /ras
Key: Delete the stored credential for Server01:
/add Add a user name and password to the list. cmdkey /delete:Server01
TargetName The computer or domain name that this entry
will be associated with.
COLOR
/generic Add generic credentials to the list. Sets the default console foreground and background colours.
Syntax
/smartcard Retrieve the credential from a smart card. COLOR [background][foreground]
Colour attributes are specified by 2 of the following hex digits. Each digit can be any of the
/user:UserName The user or account name to store with this following values:
entry.
0 = Black
Windows Command Prompt www.nubielab.com Page 12
13. 8 = Gray pathname2 The path and filename of the second file(s)
1 = Blue /D Display differences in decimal format. (default)
9 = Light Blue /A Display differences in ASCII characters.
2 = Green /L Display line numbers for differences.
A = Light Green /N=number Compare only the first X number of lines in the
file.
3 = Aqua /C do a case insensitive string comparison
B = Light Aqua Running COMP with no parameters will result in a prompt for the 2 files and any options
4 = Red To compare sets of files, use wildcards in pathname1 and pathname2 parameters.
C = Light Red
When used with the /A option COMP is similar to the FC command but it displays the individual
5 = Purple characters that differ between the files rather than the whole line.
D = Light Purple To compare files of different sizes, use /N= to compare only the first n lines (common portion of
each file.)
6 = Yellow
E = Light Yellow COMP will normally finish with a Compare more files (Y/N) prompt
to suppress this: ECHO n|COMP <options>
7 = White
F = Bright White
If no argument is given, COLOR restores the colour to what it was when CMD.EXE started.
COPY
Copy one or more files to another location
Syntax
Colour values are assigned in the following order: COPY source destination [options]
The DefaultColor registry value. COPY source1 + source2.. destination [options]
The CMD /T command line switch
The current colour settings when cmd was launched Key
source : Pathname for the file or files to be copied.
The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute the COLOR
command with a foreground and background colour that are the same. /A : ASCII text file (default)
/B : Binary file copy - will copy extended characters.
COMP.exe destination : Pathname for the new file(s).
Compare two files (or sets of files). Display items which do not match.
Syntax
/V : Verify that the new files were written correctly.
COMP [pathname1] [pathname2] [/D] [/A] [/L] [/N=number]
[/C]
/N : If at all possible, use only a short filename
(8.3) when creating
Key
a destination file. This may be necessary when
pathname1 The path and filename of the first file(s)
copying between disks
Windows Command Prompt www.nubielab.com Page 13
14. that are formatted differently e.g NTFS and VFAT, COPY "C:my worksome file.doc" "D:New docsnewfile.doc"
or when archiving
data to an ISO9660 CDROM. Specify the source only, with a wildcard will copy all the files into the current directory:
COPY "C:my work*.doc"
/Z : Copy files in restartable mode. If the copy is
interrupted Specify the source with a wildcard and the destination as a single file, this is generally only
part way through, it will restart if possible. useful with plain text files.
(use on slow networks) COPY "C:my work*.txt" "D:New docscombined.txt"
/Y : Suppress confirmation prompt (Windows 2000 only) Quiet copy (no feedback on screen)
COPY oldfile.doc newfile.doc >nul
/-Y : Enable confirmation prompt (Windows 2000 only)
Prompt to overwrite destination file
NT 4 will overwrite destination files without any prompt, Windows 2000 and above will prompt
unless the COPY command is being executed from within a batch script. DEL
To force the overwriting of destination files under both NT4 and Windows2000 use the Delete one or more files.
COPYCMD environment variable: Syntax
SET COPYCMD=/Y DEL [options] [/A:file_attributes] files_to_delete
This will turn off the prompt in Win2000 and will be ignored by NT4 (which overwrites by Key
default) files_to_delete : This may be a filename, a list of files or
Binary copies a Wildcard
"COPY /B ... " will copy all the files in binary mode , you can also put /B after any one file to
copy just that file in binary. options
/P Give a Yes/No Prompt before deleting.
Combine files /F Ignore read-only setting and delete anyway (FORCE)
To combine files, specify a single file for the destination, but multiple files as the source. To /S Delete from all Subfolders (DELTREE)
specify more than one file use wildcards or list the files with a + in between each /Q Quiet mode, do not give a Yes/No Prompt before deleting.
(file1+file2+file3)
When copying multiple files in this way the first file must exist or else the copy will fail, a /A Select files to delete based on file_attributes
workaround for this is COPY null + file1 + file2 dest1
COPY will accept UNC pathnames file_attributes:
Copy from the console (accept user input) R Read-only -R NOT Read-only
COPY CON filename.txt S System -S NOT System
Then type the input text followed by ^Z (Control key & Z) H Hidden -H NOT Hidden
To do this in Powershell use the following function: A Archive -A NOT Archive
function copycon {
[system.console]::in.readtoend() Wildcards: These can be combined with part of a filename
}
Examples: * Match any characters
? Match any ONE character
In the current folder Examples:
COPY oldfile.doc newfile.doc
To delete HelloWorld.TXT
Copy from a different folder/directory: DEL HelloWorld.TXT
Windows Command Prompt www.nubielab.com Page 14
15. you will then be able to delete the file.
To delete "Hello Big World.TXT" To cure the problem permanently - Control Panel, Add/Remove programs, Win Accessories,
DEL "Hello Big World.TXT" indexing service.
Delete Locked files (Typically IE temp files or the Offline cache)
To delete all files that start with the letter A This works on any version of NT, 2000 or XP
DEL A* Close all applications
Open a command prompt
To delete all files that end with the letter A Click Start, and then Shut Down
DEL *A.* Simultaneously press CTRL+SHIFT+ALT.
While you keep these keys pressed, click Cancel in the Shut Down Windows dialog box.
To delete all files with a .DOC extension In the command prompt window, navigate to the cache location, and delete all files from the
DEL *.DOC folder (DEL /s)
At the command prompt, type explorer, and then press ENTER.
To delete all read only files
DEL /a:R *
DELTREE
To delete all files including any that are read only
DEL /F * Previous versions of Windows had the DELTREE command that deletes all files and sub folders.
DEL /s will delete all files
Folders RD /s will remove all files and folders including the root folder.
:: Remove all files and subfolders but NOT the root folder
If a folder name is given instead of a file, all files in the folder will be deleted, but the folder
:: From tip 617 at JsiFAQ.com
itself will not be removed.
@echo off
pushd %1
Temporary Files
del /q *.*
You should clear out TEMP files on a regular basis - this is best done at startup when no
for /f "Tokens=*" %%G in ('dir /B') do rd /s /q "%%G"
applications are running. To delete all files in all subfolders of C:temp but leave the folder
popd
structure intact:
Normally DEL will display a list of the files deleted, if Command Extensions are disabled; it will
DEL /F /S /Q %TEMP%
instead display a list of any files it cannot find.
When clearing out the TEMP directory it is not generally worthwhile removing the subfolders
ERASE is a synonym for DEL
too - they don't use much space and constantly deleting and recreating them can potentially
increase fragmentation within the Master File Table.
DELPROF (Resource Kit)
Deleting a file will not prevent third party utilities from un-deleting it again, however you can Delete windows user profiles.
turn any file into a zero-byte file to destroy the file allocation chain like this: Syntax
DELPROF [options]
TYPE nul > C:examplesMyFile.txt
DEL C:examplesMyFile.txt Key
Undeletable Files /Q Quiet, no confirmation.
Files are sometimes created with the very long filenames or reserved names: CON, AUX,
COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL /I Ignore errors and continue deleting.
To delete these use the syntax: DEL .C:somedirLPT1
Alternatively SUBST a drive letter to the folder containing the file. /P Prompts for confirmation before deleting each
If a file (or folder) still appears to be 'undeletable' this is often caused by the indexing service. profile.
Right click the file you need to delete, choose properties, advanced and untick "allow indexing"
Windows Command Prompt www.nubielab.com Page 15
16. /C:computer_name
Delete profiles on a remote computer. /O:N Name /O:-N Name
/O:S file Size /O:-S file Size
/D:Number_of_days /O:E file Extension /O:-E file Extension
Only delete profiles that have been inactive for /O:D Date & time /O:-D Date & time
'X' Number of days (or greater) /O:G Group folders first /O:-G Group folders last
several attributes may be combined e.g. /O:GEN
/R Delete roaming profile cache only ##
[time] /T: the time field to display & use for sorting
## = New in version 5.2 (XP resource kit) /T:C Creation
Example: /T:A Last Access
/T:W Last Written (default)
delprof /D:14
[options]
/S include all subfolders.
/R Display alternate data streams. (Vista and above)
DIR /B
/L
Bare format (no heading, file sizes or summary).
use Lowercase.
Display a list of files and subfolders
/Q Display the owner of the file.
Syntax
DIR [pathname(s)] [display_format] [file_attributes]
/N long list format where filenames are on the far right.
[sorted] [time] [options]
/X As for /N but with the short filenames included.
Key
[pathname] The drive, folder, and/or files to display,
/C Include thousand separator in file sizes.
this can include wildcards:
/-C don't include thousand separator in file sizes.
* Match any characters
/4 Display four-digit years
? Match any ONE character
The switches above may be preset by adding them to an environment variable called DIRCMD.
For example: SET DIRCMD=/O:N /S
[display_format]
/P Pause after each screen of data.
/W Wide List format, sorted horizontally. Override any preset DIRCMD switches by prefixing the switch with -
/D Wide List format, sorted by vertical For example:
column. DIR *.* /-S
Upper and Lower Case filenames:
[file_attributes] /A: Filenames longer than 8 characters - will always display the filename with mixed case as
entered.
/A:D Folder /A:-D NOT Folder Filenames shorter than 8 characters - may display the filename in upper or lower case - this may
/A:R Read-only /A:-R NOT Read-only vary from one client to another (registry setting)
/A:H Hidden /A:-H NOT Hidden
/A:A Archive /A:-A NOT Archive To obtain a bare DIR format (no heading or footer info) but retain all the details, pipe the output
/A Show all files of DIR into FIND, this assumes that your date separator is /
several attributes may be combined e.g. /A:HD-R DIR c:temp*.* | FIND "/"
[sorted] Sorted by /O:
Windows Command Prompt www.nubielab.com Page 16
17. FOR /f "tokens=*" %%G IN ('dir c:temp*.* ^| find "/"') DO echo End localisation of environment changes in a batch file. Pass variables from one batch file to
%%G another.
Normally DIR /b will return just the filename, however when displaying subfolders with DIR /b Syntax
/s the command will return a full pathname. ENDLOCAL
If SETLOCAL is used to make variables 'local' to one batch script, then those variables will be
Checking filesize during a download (to monitor progress of a large download) invisible to all other batch scripts unless explicitly passed using an ENDLOCAL & SET...
TYPE file_being_downloaded >NUL command.
DIR file_being_downloaded If SETLOCAL is used without a corresponding ENDLOCAL then local environment variables
will be discarded when the batch file ends. Ending the cmd.exe session will discard all
Environment Variables both local and global.
ECHO Passing variables from one routine to another
Display messages on screen, turn command-echoing on or off.
Syntax The CMD command processor always works on a line-by-line basis, so it will convert all
ECHO [ON | OFF] %variables% into their text values before executing any of the commands.
ECHO [message]
Key By putting ENDLOCAL & SET commands on a single line you are able to SET a variable just
ON : Display each line of the batch on screen (default) before the localisation is ended by the ENDLOCAL command.
OFF : Only display the command output on screen
message : a string of characters to display
Type ECHO without parameters to display the current echo setting (ON or OFF). Examples:
::Sales.cmd
In most batch files you will want ECHO OFF, turning it ON can be useful when debugging a
problematic batch script. @Echo off
SETLOCAL
In a batch file, the @ symbol is the same as ECHO OFF applied to the current line only. Set _item="Ice Cream Maker"
Set _price=450
Normally a command is executed and takes effect from the next line onwards, @ is a rare ENDLOCAL & SET _return1=%_item%& SET _return2=%_price%
example of a command that takes effect immediately.
::Results.cmd
Command characters will normally take precedence over the ECHO statement
@Echo off
e.g. The redirection and pipe characters: & < > | ON OFF
SETLOCAL
CALL Sales.cmd
To override this behaviour you can escape each command character with ^ as follows:
Echo [%_return1%] will cost [%_return2%]
ECHO Nice ^&Easy
ECHO Salary is ^> Commision
ECHO Name ^| Username ^| Expiry Date
::SubDemo.cmd
ECHO:Off On Holiday
Echo text into a FILE
@Echo off
SETLOCAL
The general syntax is
CALL sub_products
Echo This is some Text > FileName.txt
Echo [%_return1%] will cost [%_return2%]
ENDLOCAL :sub_products
SETLOCAL
Windows Command Prompt www.nubielab.com Page 17
18. Set _item="Coffee Grinder" echo %errorlevel%
Set _price=150 goto :eof
ENDLOCAL & SET _return1=%_item%& SET _return2=%_price% :setError
Multiple SET commands may be added to pass multiple variables, just prefix each with an & exit /B 5
Be aware that any trailing spaces will be added to the variables value. To make this more flexible you can change the subroutine to set any errorlevel like this:
Improving readability :setError
The 'ENDLOCAL & SET' technique described above can become difficult to read if you have a exit /B %1
lot of SET commands all on the same line. This can be made easier to read if you first store all
the Set assignments in a single variable (_returns) as shown below (thanks to Ilya Bobyr for this
technique)
Set _returns=^
EXPAND
Set _return1=%_item%^&^ Uncompress one or more compressed files.
Set _return2=%_price%^&^ Syntax
Set _return3=%_discount%^&^ EXPAND Source Destination
Set _return4=%_delivery% EXPAND -r Source Destination
EXPAND -r Source
Endlocal & %_returns%
In these examples we have used the variable names _return1, _return2 etc, but you can use any
Options
names for the return variables, even re-use the exact same variable name inside and outside the
ENDLOCAL command (SET _price=%_price%)
Source : Source filename or a wildcard
EXIT Destination : Destination filename or folder
Quit the current batch script, quit the current subroutine or quit the command processor
(CMD.EXE) optionally setting an errorlevel code. -r : Rename the files
Syntax EXPAND
EXIT [/B] [exitCode] Uncompress one or more compressed files.
Syntax
Key EXTRACT [options] CAB_file [filenames]
/B When used in a batch script, this option will exit
only the script (or subroutine) but not CMD.EXE Key
CAB_file : Cabinet file
exitCode Sets the %ERRORLEVEL% to a numeric number.
If quitting CMD.EXE, set the process exit code no. filenames : Name of the file to extract from the cabinet
You should never attempt to directly write to the %errorlevel% variable, (i.e. don't try anything Wild cards (*.*) (.) and multiple files are valid
like SET errorlevel...) using the EXIT command provides a safe way to alter the value of the
built-in errorlevel variable. options
Examples /A Process ALL cabinets. (where CABs are linked)
:: Exit if a required file is missing
@echo off /C If the CAB contains one file then /C will
If not exist MyimportantFile.txt Exit /b copy from DMF disks
Echo The file was found
:: Set the error level to 5 /D Display CAB directory
@echo off
call :setError /E Extract all (use instead of *.* to extract all
files)
Windows Command Prompt www.nubielab.com Page 18
19. Powershell also has an Alias FC for the Format-Custom command, therefore to run the 'old' FC
/L dir Location to place extracted files (default is under powershell you need to explicitly run C:windowssystem32fc.exe
current folder)
To identify 2 identical files use this syntax:
/Y Overwrite files without any prompt FC file1.txt file2.txt | FIND "FC: no dif" > nul
IF ERRORLEVEL 1 goto :s_files_are_different
FC.exe Example:
Compare the contents of two files or sets of files. Display any lines which do NOT match.
If two files are compared and the four lines of text match as follows
Syntax
FC /B pathname1 pathname2
1: different
2: same
FC [options] pathname1 pathname2
3: same
4: different
Key
/B : Perform a binary comparison.
Specifying /nnnn =2 the file compare will display the 4th line and continue
options Specifying /nnnn =3 the file compare will halt at the 4th line (files too different)
/C : Do a case insensitive string comparison Specifying /LB1 the file compare will halt after the first line
FIND
/A : Displays only first and last lines for each set of Search for a text string in a file & display all the lines where it is found.
differences. Syntax
FIND [/V] [/C] [/N] [/I] "string" [pathname(s)]
/U : Compare files as UNICODE text files.
/L : Compares files as ASCII text. (default) key
/V : Display all lines NOT containing the specified string.
/N : Display line numbers (ASCII only)
/C : Count the number of lines containing the string.
/LBn: Limit the number of lines that will be read, "n" sets a
maximum number /N : Display Line numbers.
of mismatches after which the File Comparison will
abort (resync failed) /I : Ignore the case of characters when searching for the
When FC aborts (resync failed) then "n" number of string.
mismatches will be shown.
"string" : The text string to find (must be in quotes).
/nnnn : Specify a number of consecutive lines that must match
after a mismatch. [pathname] : A drive, file or files to search.
This can be used to prevent the display of the two If a [pathname] is not specified, FIND will prompt for text input or will accept text piped from
files from getting another command.
too out of sync (use CTRL-Z to end manual text input)
/T : Do not expand tabs to spaces. Examples:
/W : Compress white space (tabs and spaces) for
comparison. If names.txt contains the following:
To compare sets of files, use wildcards in pathname1 and pathname2 parameters. Joe Bloggs, 123 Main St, Dunoon
Arnold Jones, 127 Scotland Street, Edinburgh
Windows Command Prompt www.nubielab.com Page 19