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.

learn more… | top users | synonyms

2
votes
1answer
222 views

Unbalanced Parenthesis in a for loop in batch

@echo off FOR /l %%A in (0,1,30) do ( set /a results=1600 + !RANDOM! %% (1900 - 1600 + 1)echo %%A--!results! ) When I run this I keep getting error "Unbalanced parenthesis" in windows xp and when I ...
0
votes
1answer
133 views

%RANDOM% environment variable is giving a single number [duplicate]

I’m having trouble with the %RANDOM% environment variable in the following command: FOR /l %%A in (0,1,30) do set /a results=1600 + %RANDOM% %% (1900 - 1600 + 1) && echo %%A--!results! I ...
1
vote
2answers
467 views

Fast NT batch script for determining path lengths in a folder

I would like to know if anyone has devised an efficient way in NT batch of computing path lengths in a given folder. This is necessary to identify files and folders which won't successfully archive ...
1
vote
1answer
706 views

Resize image to a maximum size on command line

I have a very big collection of very big images, and I want to create a thumbnail gallery in which images are resized to a maximum-minimum-width (you will understand) of 180px. For example: If the ...
0
votes
0answers
25 views

Batch script for replacing the same file from one folder to another folder [duplicate]

I have two folders where in src folder contains the original files and the destination folder contains the modified files. I want to replace the original file with the modified file which will have ...
0
votes
1answer
489 views

forfiles.exe not working for c:\users\internet\downloads or documents

I am getting could not find c:\users\internet\downloads\new.txt when i run the script in cmd is it because there's a lock icon on the user account on windows7, the script works fine if i change ...
0
votes
2answers
1k views

Using sqlplus as tnsping alternative

Is it possible to use sqlplus as an alternative for tnsping since tnsping wasn't installed with the oracle setup. I simply want to check via batch script, whether the definitions from the tnsnames.ora ...
1
vote
1answer
49 views

How to check variable with line break

I'm writing this script and I need it to check if some drives are connected, for that I'm using fsutil fsinfo drives and I'm saving the output in a var. Then, I check with an 'if' if the var is what I ...
0
votes
2answers
1k views

Batch filling multiple forms using data from Excel

I have an excel file which contains many rows of data, each row has columns like last name, first name, gender etc. I would like to batch fill these data into multiple forms of different types. ...
1
vote
1answer
992 views

Detecting computer name

How can I detect if I am on a certain host computer in a batch script? Ex if I run the command hostname it gives me the current computers hostname. Is there a way that I can save that to a variable or ...
0
votes
1answer
109 views

organizing images by resolution with batch files [closed]

Doing some digging I'm trying to figure out a command line solution for organizing very large archives of images based on their resolution into folders, 1920x1080, 1600x1200, 1600x900, etc. I've ...
0
votes
2answers
2k views

Print current time (with milliseconds)

I want this command in windows with cygwin installed, so any Linux command will work for me.
1
vote
1answer
872 views

Reconfiguring, then deleting obsolete pagefile.sys from C: in one go using a batch script

I'm trying to set up an automated script for a Windows XP installer. It's a batch script that runs on first boot after installation, and among the things I'm trying to accomplish, is removing the ...
0
votes
1answer
372 views

Batch file to find specific services that are not running

I have a set of services that I need to check to see if they are running or not. Some have set names, i.e. (ServiceX, ServiceY) The rest all start with a prefix. so far I have sc query | find ...
-2
votes
1answer
9k views

Delete files older than 7 days in folder and its subfolder [duplicate]

I need to have a windows batch file which deletes all files which are older than 7 days in a folder and its sub folders without deleting any folders.
5
votes
3answers
6k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
0
votes
2answers
112 views

.bat file overriding answer

When I made this batch file, when typing y and n for the first time it works fine, but as soon as I choose n, every single time I try inputting something, it opens up the 7000 songs wpl list then ...
0
votes
2answers
215 views

Batch file to create many files with special characters

Essential info: I have a file "DB_OUTPUT.TXT" with 304 lines that I need to turn into 304 files (one per line). Each line contains many special characters and may be up to tens of thousands of ...
0
votes
2answers
5k views

Batch IF .exe is not running

I am trying to create a batch that IF program.exe is not running in process, it will run code below. In vb.net this is easy, but I do not want to create a program. I am guessing a VBS script would ...
0
votes
1answer
220 views

How to batch rename files using bash

I know there are lots of such questions, but I couldn't find one (or a combination of several), which describes the things I want to do. I think I need to use regular expressions, but I am not very ...
0
votes
0answers
272 views

Windows Batch Script Generates runtime error R6016 - not enough space for thread data

I am running a Batch Script that is 1 FOR /F %%i loop and it is currently running over 5k files totaling 62mb. I am using Windows 7. The error doesn't generate everytime I run it. It seems to only ...
1
vote
1answer
698 views

Apply jpegtran.exe to directory

I am trying to optimize a directory of images with jpegtran.exe but I can't figure out how to make it work. Does anyone have experience with this? I found this article about scripting jpegtran but ...
1
vote
2answers
1k views

Batch script to remove # from a file name (only in a specific directory)

I'm looking for a script to remove the # character out of any file names in a specific directory (PDF documents). I've been looking at some similar examples, but it's all a bit confusing!
0
votes
1answer
215 views

Save all WLAN profile names stored on my machine, into a textfile

when I'm using the netsh wlan command, a similarly output is shown. C:\Windows\system32>netsh wlan show profiles Profiles on interface Wireless Network Connection: Group policy profiles (read ...
0
votes
0answers
135 views

Batch file to read a text file with folder and file names and write to another file the ones that do not exist

I have a file of approx 30,000 folder/file names that I need to confirm if each one exists. If a file does not exist, I want to write the full path and file name to an "error.txt" file. Can anyone ...
0
votes
1answer
542 views

How can I print a batch of files with custom printer settings?

I have a collection of A3-size (tabloid size) PDF drawings which I would like to print as a batch. The particular printer I am using doesn't automatically check the paper size of the document - it ...
0
votes
1answer
209 views

Start jade via batch script as service on windows server 2012 amazon ec2 instance

I would like to start the Jade agent platform with a batch script on an windows server ec2 instance as a service. The reason for this is, that I want to start jade automatically at system startup. ...
0
votes
2answers
100 views

Batch-Script for copying and overwritting existing files

So I've got a file called modified.txt, however the same file is in a bazillion folders and subfolders. I want to copy the modified.txt to all these bazillion folders and subfolders and overwritte ...
0
votes
1answer
225 views

Build a user's profile directory on creation in batch

I have a batch script that I use when I set up new Windows 7 PCs that creates a user based on a variable, creates a folder on their desktop, then shares it: @echo off SET /p unitnumber="Enter ...
0
votes
1answer
2k views

Windows CMD Batch, START, output redirection, but appending

i currently have issues with output redirection of cmd. I use "start" command to call another wayne.bat and want its output to be redirected. This works, but everytime i start my .bat (what happens ...
0
votes
1answer
2k views

Move all files from multiple level sub folders to 2nd level subfolder

I'm looking for windows command or batch script to help me, i Spent 3h reading/ trying to find a solution i know its out there but my lack of scripting/programming isn't helping, hoping some can help ...
3
votes
2answers
47 views

How to divide an audio file using a list of times?

I've found quite a few programs to divide audio files, but none allow for batch splitting an audio file using arguments. I have several 5 hour and longer audio files (mostly MP3, but I could just as ...
1
vote
4answers
2k views

Linux: Run command on a batch of files, with matching output files

A simple task: given a directory of files and a command that takes one file as input and produces one file as output, I want to process all the files in a directory at once and output them with ...
0
votes
1answer
58 views

How can I batch insert a certain .txt file into every subfolder?

I'm trying to figure out how to insert a licence.txt file into every subfolder, any ideas how to do this in windows command line?
0
votes
0answers
81 views

Using Task Scheduler to Run a Task possibly using event id.. i guess

I have created a task which runs on daily basis at startup, and set the computer BIOS to automatically start at 9:00 AM everyday. Also, set the powerloss - last state (this only works when the PC is ...
1
vote
3answers
6k views

Kill processes with batch file?

Whenever I start my computer up, there are numerous programs running in the background that I usually don't need , which take up a decent amount of memory. Is there a way to kill processes in a ...
0
votes
1answer
171 views

Converting Windows batch to Linux script (Batch create symbolic links by first character)

As a noob to Linux and scripting I'm unsure as to how to convert this into a linux script or even where to start. Essentially I want to create a script that creates alphabetized folders A-Z, symlink ...
3
votes
2answers
772 views

How can I start/stop a Windows Service through a Linux bash script?

I want to create a script that will be kicked off through an SSH server to start/stop a Windows service. The SSH user is part of the Administrator group. However, when I execute the script, I get an ...
-1
votes
1answer
327 views

Batch or VBscirpt to copy only folder structure(Not Files) from one server to another server by giving folder structure as an separate input file

Example: Source: Server 1: C:\Folder1\Test2 C:\Folder2\Test3 C:\Folder3\Test1 Destination: Server 2: (Same structure above should be copied here with permissions) Note: In script, have to call the ...
1
vote
1answer
283 views

BATCH SET unable to use divide operator

I am unable to divide using the divide operator provided in the SET command. SET /A 216/18 SET /A div=216/18 ECHO %div% Though this should work and it does in the command prompt window ...
2
votes
2answers
543 views

Finding a free port with batch

How can I find a free port with a batch file? I tried to run a loop and using the netstat -o -n -a it will increment a variable until the port is not found in the netstat list But I'm also not sure ...
3
votes
1answer
1k views

How can I bulk move and rename images/videos in a folder

All my mobile device's photos and videos are backed up to the cloud and synchronized to my laptop using Dropbox's "Camera Upload" feature. All the photos and videos get added to the "camera uploads" ...
2
votes
1answer
82 views

Log ping and date isnt 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% ...
1
vote
1answer
3k views

Creating Task With a Batch File - run task as soon as possible if missed

When creating a task with a batch file or command line, how do I specify the following option? "Run task as soon as possible after a scheduled start is missed " I know that this option exists via ...
1
vote
2answers
5k 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 ...
0
votes
1answer
96 views

windows net user command to work with network service

This might be a trivial question but I was wondering if it was possible to use the net user command in windows to give back useful information on the "NT Authority\Network Service" user. I have tried ...
1
vote
2answers
5k views

How to create a desktop shortcut from a batch file

I know there are many posts on this issue but there is a minor twist to what I need to do. I can figure out how to create a shortcut with an argument like this: "C:\Program Files\My App\App.exe" /s ...
1
vote
2answers
560 views

Creating a drag and drop batch file to split an MP3 using ffmpeg

I've got a folder full of FFMPEG batch files that I've written to do various conversion tasks. These allow me to drag and drop a bunch of files and do a conversion - for example, decompressing MP3 to ...
0
votes
2answers
53 views

Create folder from specific multiple files, and then move specific multiple files into it

I have some files 07-01.jpg 07-02.jpg until 07-48.jpg 37-01.jpg 37-02.jpg 37-03.jpg until37-48.jpg I want to create folder 07, 08.... ,37 and then move multiple files 07-01.jpg, 07-02.jpg, ...
1
vote
1answer
238 views

How to “reuse” a regex find and replace in Vim

I have a plain text file with entries as firstAuthorLastName_titleFirstWord_YYYY that I change to firstAuthorLastNameYYYYtitleFirstWord with the following s// command in Vim.^[1] ...