Batch processing is the execution of a set of commands or software programs without user intervention. A batch file is a text file containing a sequence of such commands or programs invocations. Please use the tag [batch-file] for that.

learn more… | top users | synonyms

54
votes
17answers
230k views

Run a batch file in a completely hidden way

I'm looking for some way to run a batch file (.bat) without anything visible to the user (no window, no taskbar name, .etc..). I don't want to use some program to do that, I'm looking for something ...
46
votes
3answers
71k views

How does the Windows RENAME command interpret wildcards?

How does the Windows RENAME (REN) command interpret wildcards? The built in HELP facility is of no help - it doesn't address wildcards at all. The Microsoft technet XP online help isn't much better. ...
26
votes
12answers
114k views

How to prevent the command prompt from closing after execution?

My problem is that in Windows, there are command line windows that close immediately after execution. To solve this, I want the default behavior to be that the window is kept open. Normally, this ...
12
votes
7answers
66k views

Enable/disable wireless interface in a bat file

Is there a way to enable/disable a wireless network interface via the command line (so I can put it in a bat file)? When I'm in the office I use a wired connection, but Windows still occasionally ...
1
vote
1answer
1k views

Adding key to registry

I would like to create a batch file, that will add registry key, not manually, but full automaticly by .BAT file. This link goes about adding everything but not the key. This link shows how to add ...
79
votes
9answers
251k views

Can you zip a file from the command prompt using ONLY Windows' built-in capability to zip files?

I have a batch file that outputs a text file. I thought it would be nice if I could zip it up too. This will be used in an uncontrolled environment, so I can't make assumptions about the presence of ...
24
votes
11answers
25k views

How do I batch change the date taken information in EXIF data?

I use F-Spot to manage my images. For one set of images, the dates somehow got messed up and they all are marked as September 1st 2007. I'd like to change the date taken information to a different ...
43
votes
5answers
66k views

Variables in batch file not being set when inside IF?

I have two examples of very simple batch files: Assigning a value to a variable: @echo off set FOO=1 echo FOO: %FOO% pause echo on Which, as expected, results in: FOO: 1 Press any key to ...
19
votes
2answers
20k views

Programatically associate file extensions with application on Windows

I've just recently reinstalled Windows and in setting up my environment I've noticed that all my associations for the various programming languages I edit in Notepad++ have gone (naturally). I am ...
34
votes
12answers
103k views

How do I create a Windows Batch file that does not show the Command Prompt when executed?

I have installed a ruby gem called Redcar, which is launched from the command line. When it runs, it steals the shell until it terminates, so I have to create a new shell window to continue doing ...
3
votes
3answers
27k views

Access denied, cmd move windows 7

I can't use this command in win 7 when want to move a directory if the destination exists. It says Access denied. Why hapens this? It worked in XP. move /y "%1" c:\mydir\ I can use robocopy, but ...
1
vote
2answers
16k views

using FORFILES in batch to delete tmp and bak files older than a week

I am having issues making this syntax work correctly. What I would like to do is remove all tmp and bak files from the specified directory and all subdirectories if the modified date is older than 7 ...
30
votes
8answers
97k views

Get current folder name by a DOS command?

Is it possible to get the current folder name (not current directory path) by using a DOS command? If so, how? The closest I got was this but it doesn't do it: for /f "delims=\" %%a in ("%CD%") do ...
37
votes
6answers
246k views

How do I make a batch file wait / sleep for some seconds?

I use a batch file to start up a few of the programs I need running in the background. Up until now, I had used the pause command to execute it after some of the other start-ups finished. I would ...
10
votes
3answers
108k views

How to create a shortcut using a batch script? [duplicate]

How can I create a shortcut to the file D:\myfile.extension on the Desktop using a batch script?
5
votes
4answers
9k views

Which free software can I use to deskew scanned images

I've scanned about 100 documents, so I have a folder with 100 jpg images, but they are rotated by the angle up to 15 degrees. Is there any free simple to use software I can use to rotate them to the ...
4
votes
5answers
5k views

How to join MP3 files? [duplicate]

Motivation I'm looking for a program that allows me to join a lot of mp3 files (an audio book) to a single large mp3 file. My mp3 player is able to remember the position inside a track, but it takes ...
14
votes
2answers
4k views

Weird characters (´╗┐) at the start of a batch file

I am working with batch files in Windows, using both Notepad, and Notepad++. When I run the batch files, which all start with @echo off, I see the first line (when running on two separate machines) ...
38
votes
10answers
32k views

Renaming many files in Mac OS X, batch processing

I used to rename file in Linux via a rename command: rename 's/old_pattern/new_pattern/g' *glob Is there something similar in Mac OS X (Snow Leopard)?
24
votes
11answers
93k views

Populating Array in DOS Batch Script

How can I setup an array variable in a DOS batch script? I would like to load it with a list of file names to process. I really would like to keep this as simple as possible. Thank you.
23
votes
10answers
53k views

Can a mapped network drive be reconnected from the command line?

On a daily basis I find myself in the Windows command prompt needing to access a network drive that is mapped but disconnected. I have yet to find a command that will reconnect this drive without ...
11
votes
6answers
25k views

How to make 7-zip do a whole bunch of folders

I got a bunch of pictures that I had to crop into 800x600 pixels. That was easily done, but now I have to upload them so the family can see them all. Thing is, this is 500MB in pictures. I decided to ...
10
votes
1answer
63k views

How to get filename only without path in windows command line?

for /r %f in (*) do echo %f Gives the output filename along with the entire path \path\to\dir\<filename> How do i get just the <filename> without the path included? I need to use that ...
8
votes
5answers
72k views

How to copy a list of file names to text file?

How can I copy the names of files in a directory to a text file or to a clipboard?
16
votes
3answers
15k views

Run a batch/cmd upon screensaver

Is there a way to run a .bat or .cmd when the screensaver starts? I've noticed some .exe can run if you rename them to .scr but is that it?
17
votes
1answer
127k views

Batch file that runs cmd.exe, a command, and then stays open at prompt

I would like to make a batch file that: Opens cmd.exe Within that Command Prompt runs net use to display mapped share paths Leaves the window open so that I can run additional commands if I wish to ...
16
votes
4answers
16k views

Using wildcards with the rmdir or rd command

Let's say there are some folder in the D: drive: D:\Air D:\Abonden D:\All D:\Whatever I want to delete all folders starting with "A" (including all subfolders and files). I tried this command: ...
15
votes
5answers
29k views

How to delete files from a folder using a list of file names in windows?

i have a folder with 2K+ files in it, i need to delete around 200, i have a txt file with all the file names i need removed ordered in a list, how do i remove the specific files from the folder using ...
6
votes
1answer
14k views

Set Permanent Environmental Variable in Windows XP

I want to set environmental variables permanently through a batch file. Is there a command to set Permanent Environmental Variable (other than SETX) for Windows XP service pack 3? command SETX ...
5
votes
7answers
27k views

How can I permanently assign drive letters to my USB devices in Windows?

I have several customers with different PCs (Windows XP, Windows Vista and Windows 7). Unlike DOS 6.22, where you can permanently assign drive letter designations (e.g. Drive C: = Hard Disk Bootable ...
10
votes
3answers
76k views

Using Date and Times in a batch file to create a file name

I am running a program from a batch file, which when it is done performs an automatic backup of my MySQL database. I would like the batch file to create a different back up for each run, so I can ...
9
votes
4answers
11k views

How to bulk-rename files with invalid encoding or bulk-replace invalid encoded characters?

I have a debian server and I'm hosting music for an internet radio station. I have trouble with file names and paths because a lot of files got an invalid encoding, for example: ./music/Bändname - ...
7
votes
5answers
12k views

how do you make a letter password generator in batch?

I'm having a hard time figuring out how to make a password generator with random letters in it. For example, ASWED-ASDWAD-EFEST. So far I can only make random numbers by using the code @echo off :...
2
votes
1answer
1k views

Can't save batch file shortly after running it on Windows 7

I'm working on a batch file in Windows 7 Ultimate. I'm using notepad++ with the runme extension. When I run the batch file and make some changes directly after that, I am not able to save the .bat ...
5
votes
3answers
14k views

Script to create folders in multiple directories using YYYYMMDD date as the folder name

At work every morning I have to create multiple file folders (using a YYYYMMDD date format as the file folder name) in different directories across our network for various departments. This is a real ...
3
votes
2answers
5k views

Batch “resize” JPEG images to a fixed file size

Changing quality of the JPEG when saving an image, changes the file size. For eg. I have the following image. Dimension: 243px x 53 px Quality:100% File Size:9.7kb Background: If I edit the image,...
2
votes
2answers
6k views

Download a File in a Batch File [duplicate]

Possible Duplicate: Download a file via HTTP from a script in Windows I've never done any scripting on Windows but now I need to write a batch file that downloads a file off the Internet (...
1
vote
5answers
7k views

How can I convert a Windows batch script to a .exe?

I have a fairly simple batch script that I would like to execute using a macro on my fancy gaming keyboard. However, SteelSeries Engine only supports opening a .exe file with the macro buttons. Is ...
1
vote
1answer
4k views

Change a drive letter from Command Prompt or batch script in Windows 8?

I have an external hard drive that I connect often to my computer. At some point it was assigned letter G: and based on that my other software works. Nowadays, suddenly it gets letter F: Is there ...
24
votes
7answers
52k views

Using Gimp to batch convert images to another format in Windows

As implied by the title, does anybody know how to use the gimp-console-[version].exe program to batch convert images between formats (with default settings) in Windows ?
8
votes
2answers
19k views

How to delete Chrome temp data (history, cookies, cache) using command line

On Windows 7, I tried running this script but still cannot clear Chrome temp data. Can someone figure out what's wrong with the script? Where do Chrome store history and cache ? Thanks ECHO ----------...
18
votes
4answers
7k views

How to disable the output of 7-Zip?

I use 7-Zip to compress files inside a batch file like this: ...\right_path\7z a output_file_name.zip file_to_be_compressed I got the following output: 7-Zip 4.65 Copyright (c) 1999-2009 Igor ...
8
votes
4answers
12k views

Batch convert TIFF images to PDF?

Are there any free utilities that will batch convert TIFF files to PDF? I've tried PDF printers like PrimoPDF & CutePDF, but these seem to require a GUI click to confirm each filename. What I'm ...
14
votes
5answers
33k views

Windows script to copy some text to the clipboard?

I am using an application that requires several attempts to log in (because of overloaded servers). This app has no "remember my password" feature. Therefore, I would like to make a script (...
20
votes
5answers
16k views

Is there any way to get the windows cmd shell to expand wildcard paths?

Occasionally, the cmd shell's inability to expand wildcard paths can really be an inconvenience. I had to pass 100 files in a directory to a program, and couldn't type *.ext. Instead, I used mingw's '...
7
votes
4answers
13k views

is there an escape for '&' character in the command prompt?

I am trying something like: set pwd = abc&123 echo password %pwd% I get the result as... '123' is not recognized as an internal or external command, operable program or batch file. password ...
7
votes
4answers
14k views

Windows: How to add batch-script action to Right Click menu

I have a few programs that creates temp files or backup files or similar files that are not important. For example, GVim for Windows by default creates a backup file in filename.txt~. I sometimes ...
6
votes
2answers
34k views

Windows batch file if else usage

Sorry I am new to this stuff. I'd like to run in a certain sequence the same bat file with different parameters. I wrote a very simple batch file: @echo off REM Note: to see all command line usage ...
3
votes
3answers
5k views

Add folder name to beginning of filename

I have a directory structure as below: Folder > SubFolder1 > FileName1.abc > Filename2.abc > ............. > SubFolder2 > FileName11.abc > Filename12.abc ...
3
votes
5answers
5k views

Free batch image watermarking software [closed]

I'm looking for a simple yet effective software to watermark a lot of photos in batch. I have to apply a transparent png watermark image on 400 photos. The program have to place the watermark at a ...