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

0
votes
0answers
82 views

Batch file or script to telnet to multiple hosts, log initial output then close and test next host

I have a large list of IP addresses from a database that I need to sanitize and determine which type of host (it'll be one of 2 device types) each IP address relates to. Is there a way of using a ...
0
votes
1answer
31 views

How to delete the profile AD attribute using dsmod or similar?

As part of a user management batch script, I need to delete the profile value from an AD User object. The syntax I'm using is as follows: dsquery user -name TEST | dsmod user -profile "" It ...
0
votes
1answer
30 views

Starting mongoDB without a visible CMD [duplicate]

I have a batch file that looks like this: del db.log start /b mongod --dbpath %~dp0 --logpath db.log It should delete the existing log file, and then start mongodb without creating a new cmd, ...
1
vote
1answer
79 views

Recursively delete files that match file name (PowerShell script)

I've been converting my old batch files to powershell scripts with decent success. However... I can't quite figure out what would be the best and efficient way to do it in this case. Here's the batch ...
9
votes
3answers
479 views

How to use “<<” in batch file or command prompt?

I know what >> is used for, it write all messages into a file instead of screen. And I guess << do reverse, I try it and receive a message: << was unexpected at this time. Please ...
0
votes
1answer
24 views

Need to move lots of consistently named files to certain folders (Windows 7)

I need to populate a bunch of folders with files of various types. The destination folder structure is as follows YEAR > COMMITTEE_NAME YEAR > YEAR MONTH COMMITTEE_NAME EX: 2015 > ADP 2015 > 2015 ...
0
votes
0answers
16 views

How can I run multiple sets of pipe-linked commands in parallel?

I want to run several sets of tasks connected by pipes in parallel like so: app1 "input_file_1" | app2 > "output_file_1" app1 "input_file_2" | app2 > "output_file_2" ... What is the cleanest ...
1
vote
2answers
34 views

Possible to write a longer than 2-line txt file using batch code? [closed]

I am working on a batch project and at the moment I am having some difficulty with making a batch file put more-then-one/ two lines of data into the txt file, for example, I have tried: echo ...
0
votes
2answers
55 views

Windows Batch commands to copy file to multiple subdirectories

I have 2 files file1.txt and file2.txt that I want to copy into a folder structure like this parentfolder subfolder1 destinationfolder subfolder2 destinationfolder ...
1
vote
1answer
110 views

Can't run batch file in Server 2012

This site rocks! I am trying to run a simple .bat file on Server 2012 that will ping another server, filter out all the lines except one, and then write to a file for later use (I then want that file ...
0
votes
1answer
32 views

How to do this in all subdirectories in parent folder using batch script?

i am total noob for scripting so i need small help with this batch script... Here is script : @ECHO OFF SetLocal EnableDelayedExpansion SET par2_path="C:\PAR2\phpar2.exe" SET par2_redundancy=10 ...
0
votes
2answers
42 views

Windows Batch file get filesystem info without elevated priveledges

I have a batch file that needs to check the filesystem and choose options for a program it's running based on the filesystem (which could be NTFS or FAT32 in this environment). For Windows systems I ...
0
votes
0answers
19 views

How can I batch resize PDFs on OSX?

I have multiple PDFs, each at A4 size, and I need them all to be resized to A5. I don't want to lose any image quality / resolution, I just want the page size to be changed. I can resize an ...
0
votes
2answers
37 views

Batch check for *.reg but only if = 1 file

I am looking to basically check if a batch file is present by wildcard *.reg, but I would like it to error if there is more than 1 .reg file. This is the code I have been trying to use, but my batch ...
1
vote
0answers
17 views

schtask Activate task when specific user login

I want to create a batch file that creates a scheduled task to run a .cmd file when a specific user logons. So far I've come up with this: @echo off schtasks /CREATE /RU %username% /TN "TaskName" /TR ...
0
votes
2answers
28 views

Prefixing output text in batch

I am trying to create a remote, WMI query script that will query a bunch of machines and tell me the MemoryChip configuration information. This way, we can find out what machines physically have 1 ...
0
votes
2answers
149 views

Removing Line Breaks From CSV for Proper Excel Import

So I've created a batch script that outputs some text to a CSV. When I open the CSV in Notepad, it looks like this, which is how I want it. 173030,8,2793,2821244 173032,1,2793,2820692 ...
0
votes
1answer
111 views

Every 5 min cron job between specific time (Windows server 2008 and batch file)

Previous colleague set up cron job every 5 min for 24 hrs. Now I need to modify this only running between 7am to 7pm. I had never learned cron job so I googled and tried but it didn't work. Task ...
-1
votes
1answer
31 views

Renaming files with batch [duplicate]

Is it possible to write a .bat-file that changes the names of all the files in a folder? For example: if I have a bunch of jpegs in a folder that have random names: File1.jpg ScreendumpA2.jpg ...
0
votes
2answers
26 views

Batch File : Not able to concatenate a loop counter value to a constant string

This is in continuation with the question here. Batch Script: Concatenating multiple files in multiple folders into one file I have 20 files with name 'new.csv' in 20 folders in the same parent ...
0
votes
2answers
96 views

Batch Script: Concatenating multiple files in multiple folders into one file

I have about 20 folders and all of them have around 100 csv files each. I want to combine all of them together into one file. How should I do this? I know about copy command to combine files of one ...
1
vote
1answer
110 views

Batch file can't delete a file “that's in use” but the file doesn't seem to exist?

I have this simple batch script: cd "C:\Users\me\AppData\Local\Microsoft\Windows\Temporary Internet Files" del *.* /f /q pause When I run it, it tells me that it cannot delete \Temporary Internet ...
0
votes
1answer
57 views

Delete last line always starting with 'TRAILER' from a text file in windows batch script

I want to remove the last line from a text file using a windows batch script. the last line will always be like 'TRAILER|'. How can i achieve that. My .txt file looks like : 1220|6963|TRUCK|5760| ...
1
vote
1answer
51 views

Mass rename folders in Win 7

Suppose a folder named 1234-xyz. I would like to rename this folder to xyz - 123. I have a ton of these folders, so going through them one by one doesn't make sense. What is the best way to do this? I ...
2
votes
1answer
33 views

Opening A File With Batch Programming

So i'm making a launcher for a game with a modded version and a vanilla version. I finally was able to open the game, but the game does not respond! I used: start "Game Title" "Path\Game.exe" The ...
3
votes
1answer
59 views

How can I move the oldest file in a directory repeatedly using a batch script?

How can I move the topmost (oldest) file in a directory one by one in a batch script (Windows 7)? I am using this script: :backup move something somewhere timeout 36000 goto backup I want to ...
2
votes
1answer
121 views

How to bulk delete all disconnected devices from Windows 7?

There are many entries in the "Devices and Printers" window showing devices which are no longer connected. How can I delete these entries all at once, ideally on the command line? This picture ...
0
votes
0answers
14 views

Moving line with regex notepad ++ [duplicate]

I want to move line down to up with regex notepad ++ or batch script windows example : Video.asp?ZoneID=791 Video.asp?ZoneID=792 Video.asp?ZoneID=793 Video.asp?ZoneID=794 Video.asp?ZoneID=795 ...
3
votes
3answers
340 views

Script to get images in folder with dimensions printed to a .txt file

As title goes, is there a script for Win 7 to get printed on a .txt file all the images (JPG, PNG, GIF ecc) inside a folder along with "filename" and "pixels dimension"? I've tried with dir on ...
2
votes
2answers
51 views

How to compress multiple files with similar names?

So I've got some 20 000 files that I want to compress and group by following logic: compress every file that have identical characters up to ( also include files that have no ( So the files are ...
2
votes
1answer
27 views

If then statement in the for loop

I'm nebiew for windows scripting. My scripts would seachs string in the file, if counted the string and checking return code in if then else statment. But, I have question, some error on if then ...
1
vote
1answer
35 views

Is there a tool similar to IEpxress or 7Zip that can pass command line arguments to a dependency [closed]

I recently discovered IExpress and would like to use it to package arbitrary scripts in any language with their respective interpreters/libraries/dependencies. IExpress and 7zip can offer all of that ...
0
votes
0answers
94 views

Unzip .gz file in windows batch script using 7zip

I have 7 zip installed on windows machine. I have to extract .gz files into .txt files. I am not able to find a suitable command to do that. I tried below : 7za e ...
0
votes
1answer
51 views

batch file opens new command prompt - how to redirect new command prompt to a file?

tia, but I'm wondering if there's a way to redirect a tomcat startup.bat call into a text file. Here's my situation: I open cmd, navigate to the needed directory, and call 'startup.bat' This opens up ...
0
votes
1answer
43 views

Batch rename folders with illegal characters * and :

I want to move thousands of folders and files from an old to a new storage system with Windows 2008 R2. Obviously a user with MAC OS has named hundreds of folders with characters - * and : - that ...
-1
votes
2answers
65 views

How to extract a string from last line in a text file -windows batch script

I have a .txt file in this format 123|abc|23456 234|rsty|68589 890|gfyu|5679 TRAILER|3| How do i extract "3" from the last line enclosed between "TRAILER|" and "3" ? Need help.
0
votes
1answer
40 views

Win 7 - Batch issue, it doesn't like spaces in folder names

You'll have to forgive me (or not) my knowledge of batch programming is fairly rudimentary. I have created a couple of batch files to help launch a game, change a system variable (to move saved games ...
0
votes
1answer
35 views

Windows batch file “was unexpected this time”.

@echo off pause set /a x=1 set /a n=0 set /p x_end=x (End)= :loop cls set /a n=n+1 set /a x=x+n+1 set /a students=n+2 echo x=%x%, n=%n%, x (End)=%x_end% if (%x%=%x_end% goto end) goto loop :end echo ...
1
vote
1answer
58 views

7zip Batch Compression for a specific file extension in different folders

I've already learn how to batch compress my files as-is with 7zip but I have something more complex need on this issue. Maybe I can explain my needs with this scenario; I have a backup folder of my ...
2
votes
1answer
30 views

Delete scheduled taskname containing space

I want to delete scheduled tasks that start with "Adobe Acrobat" eg "Adobe Acrobat 123","Adobe Acrobat 456","Adobe Acrobat 789" schtasks /Delete /TN Adobe* /F This command fails to find any tasks ...
0
votes
3answers
53 views

How to access folder path from first input parameter and how to call IF Loop in batch file?

@Echo OFF SET FilePath=%1 SET HeaderFilePath=%2 SET RetrunCode="0" Call :sub %FilePath% exit /b :sub SET FileName=%~n1 SET FilePath=%1 SET "FileType=.zip" CALL SET ...
0
votes
2answers
46 views

Batch: How to forward data to new CMD instance as arguments

I'm looking to call another CMD instance and pass data to it from the parent instance. I'm aware of the general route of using variables, but it would not be feasible in this case as endlocal and ...
2
votes
2answers
42 views

Batch: avoiding specific conflict in FOR loops

Problem: unexpected behavior (single duplicate) in FOR-loop. I'm trying to make a simple batch-vbscript interface for mounting and dismounting volumes, among other tasks ("Voltask"). A central part ...
0
votes
1answer
45 views

Rename txt files based on the file's content (OSX)

I have about 250 txt files that are all named link.txt and they have this information always on the line/row 3: title: Some kind of title I need some kind of script that can go through these ...
-1
votes
1answer
34 views

How to set variable's value inside if block when value includes parenthesis

I am having problem in setting value inside if block. Please consider the following code : \mytool.bat @echo off if not "%adder%" == "" ( set val=%val%;%adder% ) else ( echo please set adder ...
1
vote
2answers
67 views

Stop/start a Windows service with a specific path?

I would like to create some scripts (Windows Batch or PowerShell, whichever will work) that can stop and start services that have their binPath in a specific folder. It will speed things up when ...
0
votes
2answers
40 views

Windows Batch File Rename Multiple Periods

I am simply basically trying to copy a file such as X.TWO.THREE to DATE.X.TWO.THREE. X is a constant while the date will be added in the future. For now I was using a constant for that as well. When ...
-4
votes
3answers
51 views

Extract text from every three lines using Windows

I have a HUGE text file with details of my site users. (11GB+). It's built like that: Email: example@gmail.com Address: 1blahblahblahblah (Bitcoin Address). Password: blahblahblah Each of the ...
0
votes
2answers
86 views

.bat file random open file for 1-5 file in folder

I need a script to run in a window to monitor my folder. When I put a jpg file in this folder, then the script running in the window should open that jpg file with photoshop droplet (.exe), wait for ...
1
vote
1answer
94 views

Error when trying to copy over the network using robocopy

C:\Users\Alex.Newton>robocopy /"\centlpf01cz6c\c$\Program Files\ProgramName\/" /" \centlpf01cz6c\Program Files\TestBatch\Test\/" ...