Top "Batch-file" questions

A batch file is a text file containing a series of commands that are executed by the command interpreter on MS-DOS, IBM OS/2, or Microsoft Windows systems.

Which comment style should I use in batch files?

I've been writing some batch files, and I ran into this user guide, which has been quite informative. One thing …

batch-file coding-style comments
What does %~d0 mean in a Windows batch file?

I'm looking at a batch file which defines the following variables: set _SCRIPT_DRIVE=%~d0 set _SCRIPT_PATH=%~p0 What …

windows batch-file
How do you find the current user in a Windows environment?

When running a command-line script, is it possible to get the name of the current user?

windows batch-file
IF... OR IF... in a windows batch file

Is there a way to write an IF OR IF conditional statement in a windows batch-file? For example: IF [%var%] == [1] …

windows batch-file if-statement cmd conditional
Assign output of a program to a variable using a MS batch file

I need to assign the output of a program to a variable using a MS batch file. So in GNU …

batch-file cmd variable-assignment windows-console
Windows batch command(s) to read first line from text file

How can I read the first line from a text file using a Windows batch file? Since the file is …

batch-file cmd
Echo off but messages are displayed

I turned off echo in bat file. @echo off then I do something like this ... echo %INSTALL_PATH% if exist %…

batch-file cmd echo
How to get the path of the batch script in Windows?

I know that %0 contains the full path of the batch script, e.g. c:\path\to\my\file\abc.bat …

windows batch-file
Any way to write a Windows .bat file to kill processes?

Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any …

performance batch-file process
How to check if a service is running via batch file and start it, if it is not running?

I want to write a batch file that performs the following operations: Check if a service is running If is …

windows windows-services batch-file scheduled-tasks