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

5
votes
2answers
14k views

FTP BAT file - Windows Scheduled Task

Is it possible to create a scheduled task in windows, that connects to an FTP site, and downloads all the files and folders within the root directory (or specified folders in the root directory) - for ...
4
votes
8answers
17k views

Why does the PING command in my batch file execute in a loop?

I created a .BAT file in Windows 7 that has the following line: PING XXX.XXX.XXX.XXX -t (XXX replaces the actual IP number). However, when I double click on this batch file, I can see the PING ...
3
votes
1answer
9k views

Batch File that copies the first 2 lines of a text file into another text file

I have a text file A.txt Pinging [xx.xx.xx.xx] with 32 bytes of data: Request timed out. Ping statistics for xx.xx.xx.xx: Packets: Sent = 1, Received = 0, Lost = 1 (100% loss) I would like to ...
2
votes
5answers
13k views

How do I check the outcome of a ftp script with a bat file? [closed]

I have a .bat file that runs a ftp script, grabbing files from the server and copying them to my machine. Works great. I now want this .bat file to report if any of these errors occured. If you ...
1
vote
4answers
16k views

How can I get the current system date and time using a command prompt?

I would like to get the current system date and time using a command prompt. How do I get the date to be in a specific format, MM-DD-YYYY HH:MIN AM/PM?
6
votes
4answers
17k views

How to execute a scheduled task with “schtasks” without opening a new command line window?

I have a batch file that creates a scheduled task using schtasks like this: schtasks /create /tn my_task_name /tr "...\my_path\my_task.bat" /sc daily ...
5
votes
4answers
27k views

bat file to disable ethernet adaptor and then reenable it after windows log in

When I log into Windows 7 I need to wait 10 seconds and then disable the Local Area Connection (ethernet adaptor) and then reenable it. I have looked through the suggested answer: Enable/disable ...
5
votes
1answer
403 views

How to prevent command line wildcard processor from evaluating short file names

I'm developing a batch file within which I'm using the following pattern: *.res I want to select all files with the extension .res, but this pattern is matching files with an extension of .resources ...
4
votes
2answers
14k views

How to create multiple folders and name them by reading lines from text file?

I have a plain text file named Export.txt. It contains a list of geographical places, preceeded by a 3 digit number with leading zeros. Example --START OF FILE-- 001 Aberdeen 002 Bellevue 003 Camas ...
4
votes
3answers
12k views

Batch Removing Newline in txt files in Windows Command line (cmd)

There are unnecessary new lines in txt files which i am merging during batch processing. I am thinking fof first removing all new lines and then inserting only one. how can i do that in batch file
4
votes
2answers
6k views

Auto-crop black margins dynamically of scanned images?

I have a notebook photocopied and the photocopy scanned, about 200 pages. For various reasons I need to print this material. There are large amounts of black areas at the sides of the page (after the ...
4
votes
2answers
8k views

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is that I need ...
3
votes
3answers
3k views

Can I get UAC prompt for user from batch file?

Can I get UAC prompt for user from batch file? For example I need put some keys to registry under CurrentControlSet from batch file by reg import path\to\my.reg PS. runas is not a solution as ...
3
votes
2answers
67 views

Batch file rename with suffix as 01 02 03 04 and so on

I have bunch of files with similar keyword like computer-stock-photo.jpg computer-stock-picture.jpg computer-picture.jpg What I want to do is suffix serial wise 2 digit numbers like computer-...
3
votes
2answers
9k views

Can I specify a destination with the ftp get command?

For example, like Windows COPY "source" "target"? or is it two steps? Use get to download to current directory Then do a copy to move to another location on my computer?
3
votes
2answers
1k views

batch convert htm files to pdf

What applications allow the user to batch convert HTM files into PDF?
3
votes
1answer
108 views

Log ping and date isn't working [closed]

:START echo %date% %time% && ping -n 1 192.168.1.1 >> pingReport.txt 2>&1 echo %date% %time% && ping -n 1 192.168.1.2 >> pingReport.txt 2>&1 echo %date% %time%...
3
votes
3answers
1k views

Batch file to poll a folder for new files

I want to write a batch file which is triggered whenever a new file is added to a particular folder. I can schedule a task using schtasks. But I am looking for a solution based upon interrupt kind ...
2
votes
1answer
564 views

Mac OSX Text to Speech Batch

I have 300 English text files that I want to make into mp3 files to listen to as and when. Is there a method, that I could use so that my Mac will batch text to speech the files to mp3 using a ...
2
votes
1answer
1k views

Script to assign and remove arbitrary secondary IPs to an interface

I'm trying to figure out how to write a script that will let me arbitrarily assign and remove a secondary IP address to a system. I'm most comfortable with batch scripting, so I'd rather focus on ...
2
votes
3answers
3k views

How to get date value in commandline

I need to do a command that takes yesterday date and builds it into a file path like this: copy "Something 2010-12-06\*.zip" "d:\Copy\" where 2010-12-6 is yesterday's date in format yyyy-mm-dd. ...
2
votes
1answer
48 views

check and warp newest files added

How am I going to automatically check all the files that were added to the directory and then warp it immediately?Because everyday I am downloading hdf files and warping it from time to time is a ...
1
vote
1answer
5k views

How to open multiple tabs in IE8 from batch file?

Upon searching for an answer to this question, I stumbled upon an almost identical question on this site, to which someone answered: "For launching multiple URLs in tabs in a single IE window, use ...
1
vote
2answers
445 views

Batch Capture incoming Netstat IPs as variable

I'm trying to figure out if there is a way I can capture (and if possible, log) the ip addresses displayed from 'netstat' command. I'm trying to make a script that waits for a ping from a specific ...
1
vote
1answer
653 views

How to batch rename files in Mac OS X?

I have the bunch of files that have names like MOV001.mpg, MOV002.mpg etc. They all have different date-time. How can I rename them so they turn into 2012 08 05 13 45 33 MOV001.mpg, 2012 09 02 23 ...
1
vote
5answers
827 views

Batch convert divx to iPhone format

I am looking for free software to do batch conversions of divx video files to iPhone format. I have read the thread: http://superuser.com/questions/5784/looking-to-convert-video-to-iphone-format ...
1
vote
2answers
593 views

Wmic output into variable

Am trying to write the output of this command into a variable, but can't quite get the syntax to work... My WMIC query is: wmic PATH SoftwareLicensingProduct WHERE "ProductKeyID like '%-%' AND ...
0
votes
3answers
195 views

Robocopy: How to copy assets from multiple locations to a single location and maintain a log

I have multiple folders containing assets (each folder has subfolders containing these assets .mp3, .txt, .png, etc). I want to copy all this assets along with the subfolder to a single location/...
0
votes
3answers
309 views

How to receive a parameter in a batch file

I have asked a question, Use an environment variable to point to an "Open With" program, which received a fantastic answer. To add myapp.exe, residing in %MYAPPSDIR%, to the Open With ...
-2
votes
2answers
143 views

How to stop every batch file opening as a process named cmd.exe as seen in task manager

This is very complicated. I'm developing a malicious batch file just to test myself. This will be done at the startup. what I have is Three + Six (hidden) Batch Files. First file makes six other ...
8
votes
4answers
52k views

Why does 'ping' returns 'request timed out' for some hosts?

For some hosts, ping www.example.com it resolves their IP but why does it fails with request time out? I have also tried to increase the ping response time but still the same result.
5
votes
1answer
1k views

Delete files from one folder if a similarly named file does not exist in another folder

I need to delete files from folder A if a file with the same name but different file type does not exist in folder B. For example: FOLDER A file1.gif file2.gif file3.gif file4.gif file5.gif file6....
4
votes
2answers
6k views

How to find the PCs name in a batch script?

How would I find the name of the PC running my batch program on it? I would like to find the name of a PC that is running my batch program and be able to store it as a variable. Any help?
4
votes
1answer
102 views

Starting Programs in a Specific Virtual Desktop

When I boot my laptop, I'd like to have two programs open, A and B. I can do this using the startup folder, but I'd like to open A in my first desktop and B in my second desktop. Is this possible in ...
4
votes
1answer
535 views

how to copy I/O not just redirect (Windows and Linux)

I have a simple call command call calabash -D sim.xpl >test.txt 2>&1 and this redirects into test.txt, how do I do both redirect into a file and allow it to show up in the prompt? (I ...
4
votes
3answers
13k views

Run a process and return its PID (as CHP.EXE) for a batch file

I'm looking for something like chp.exe, it can runs a command and returns its pid. I can not use CHP.EXE because it seems to be reported as infected file in some antiviruses. Thanks
3
votes
1answer
24 views

batch file to move files from sub dirs to root dir with overwritting files with name conflicts

So requesting some help, I am currently trying to sort out a mess in my google photos. I have downloaded the archive of my google photos and have a bunch of folders with files/photos in them. I am ...
3
votes
1answer
19k views

Change NIC speed/duplex settings in script?

I have a laptop running Windows Server 2003 SP2, with PowerShell installed. Occasionally, this system has to be used in environments where it needs the NIC manually set to 100 Mbps/Full Duplex in ...
3
votes
1answer
107 views

Building a DOS batch script to rename files

I'm currently stuck on an issue with a DOS batch script I’ve been working on, and I need help renaming the files. Here is the renaming scheme I’m searching for: Original filenames ...
3
votes
0answers
40 views

Taking screenshots when I'm not logged in

I'm looking to take several screenshots from an application at a certain time of the day (let's say 3 o'clock, when I'm certainly not logged in) . Currently I'm using NirCmd to take the screenshots, ...
3
votes
1answer
5k views

Append to start of filename

I'm trying to add the word [Replay] to all mp3 files in a folder using a batch file like so: @echo off for %a in (c:\folder\*.mp3) do ren %a [Replay]%a But it wont rename the files. all the ...
3
votes
3answers
3k views

How to change the extension of all selected files at once?

Its possible to rename files all at once. But its not possible to change the extension of selected files all at once. If windows doesn't support this facility .. then is there any batch script or ...
3
votes
2answers
2k views

How do I detect the number of parameters to a batch file and loop through them?

Is there an easy way to detect the number of parameters passed as arguments to a batch file, and then use for /L to loop through them?
3
votes
2answers
2k views

Why do .bat scripts get locked after execution in Windows 7?

Ever since I moved to Windows 7, whenever I am am developing a .bat script I have exactly one chance to get it right. As soon as I execute the script, it becomes locked by an unknown process even if ...
3
votes
1answer
951 views

Freeware FTP client with batch processing support [closed]

Is there a freeware FTP client with batch processing support? I have 50 IP addresses that I need to upload to. How do I make this as simple as possible?
2
votes
3answers
3k views

Dash or Slash in batch file?

It seems that either a dash - or a slash / will work equally well in a batch file. The two examples below are equaly valid. Which is correct? Does it depend on the operation system? If so how do I ...
2
votes
1answer
74 views

How to load files according to Created Date in Windows command prompt

In SQL Server using xp_cmdshell, I was able to load files according to Modified date using a command for e.g., z: & forfiles /m *.jpg /s /d 07/16/2015 /c “cmd /c echo @fdate @ftime @path” But I ...
2
votes
2answers
9k views

Unzip file from source to destination within user directory across multiple versions of windows

I have a source zip file which is located in a user's "My Documents" directory. It is guaranteed to always be there. I'm looking for a way to create a batch or script which will let me unzip that file ...
2
votes
3answers
2k views

Can I turn Caps on/of from a batch file in Win 7?

I have a very old program that needs the commands to be all caps. when I exit this program I often forget to put the Caps Lock off (very annoying). I had a batch program in XP that did this but can't ...
2
votes
1answer
668 views

Making PowerShell assume the working directory of a called Batch file

I regularly work interactively with a batch script that I can't easily change. One of the features of this script is as a navigation aid - it understands my company/product's code layout conventions ...