Windows Batch
Batch files can be used to automate simple processes in Microsoft Windows. Batch files use the commands of the command prompt, in the simplest case these cmd commands can be entered in a simple text file line by line, it is then executed one command after the other. Windows batch originate from the MS-DOS era. At that time batch files had the file extension .bat. Since Windows 2000 the extension .cmd is used. Additionally there is the possibility to use jump labels or variables, up to more complex processes. From a certain complexity batch files are no longer the first choice. The successor of Windows Batch is Microsoft PowerShell.
how to create a batch file - basics
A simple batch file is a text file containing a set of command prompt commands. A simple editor is sufficient to create the batch file. A text file saved in Windows/DOS with the extension .cmd or .bat, can be executed directly. Especially for very simple processes, for example copying files or folders, batch files may still be easier than using PowerShell. At the latest, if commands should not be executed in sequence and certain if-queries, loops or functions are necessary, I would recommend the... ... continue reading
Practical examples with batch
Handling variables in Windows Batch (command prompt) Read all variables Variables can be read out in the command prompt with the set command: ... continue reading
Structure of a batch file Syntax: echo off cmd
If you have created a batch file, you can write a command in each line, see: how to create a batch file - basics. The commands are executed in sequence when the file is started. The behavior of the output can be adjusted as follows: ... continue reading
Sequence loops and jump labels batch file: loop goto
Jump marks: Example: ... continue reading
cmd command Windows Management: Control Panel cpl and msc
cmd command Windows Administrative Tools: Control Panel cpl and msc ... continue reading
CMD Commands Overview: BATch Commands Windows Command Prompt
An introduction to Windows-BATch or the Windows-Command-Line can be found here: Windows Batch ... continue reading
sleep or wait in batch files: pause cmd
The function wait or sleep was not available in BATch files by default.Remedy is a small detour via the ping Command ... continue reading
Robocopy example - server relocation
Even in times of Windows PowerShell there are certain commands that still do not have a worthy successor in Windows PowerShell. One of these commands is undoubtedly the good old robocopy command. ... continue reading
Execute remote commands with psexec pstools - cmd Windows
The pstools can be used to execute commands on other computers: Of course, this requires the necessary rights for the remote connection: by default, these are the domain administrator or the local administrator. As an alternative for a remote connection to another computer, PowerShell remoting can also be used, see: Powershell Remote ... continue reading