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.

How do I shutdown, restart, or log off Windows via a bat file?

I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power …

windows batch-file command-line restart shutdown
How can I pass arguments to a batch file?

I need to pass an ID and a password to a batch file at the time of running rather than …

batch-file arguments
How to sleep for five seconds in a batch file/cmd

Windows's Snipping tool can capture the screen, but sometimes I want to capture the screen after five seconds, such as …

batch-file timeout
How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name?

Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because …

windows datetime batch-file cmd
How to "comment-out" (add comment) in a batch/cmd?

I have a batch file that runs several python scripts that do table modifications. I want to have users comment …

batch-file cmd comments comment-conventions
Batch file to copy files from one folder to another folder

I have a storage folder on a network in which all users will store their active data on a server. …

batch-file file-io
Batch file to delete files older than N days

I am looking for a way to delete all files older than 7 days in a batch file. I've searched around …

windows date batch-file file-io cmd
In Windows cmd, how do I prompt for user input and use the result in another command?

I have a Windows .bat file which I would like to accept user input and then use the results of …

windows batch-file prompt
How to check if a file exists from inside a batch file

I need to run a utility only if a certain file exists. How do I do this in Windows batch?

windows batch-file
Bat file to run a .exe at the command prompt

I want to create a .bat file so I can just click on it so it can run: svcutil.exe /…

windows batch-file exe