Questions tagged [batch]

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.

Filter by
Sorted by
Tagged with
1
vote
1answer
17 views

Switch users batch file on a PC with ForceAutoLogon

I would like to run a batch file to get to the login page, is there a way to bypass the ForceAutoLogon setting in a batch file, like you can with shift and gui menus? I have a PC with a default user ...
0
votes
0answers
8 views

Combining batch files so double click performs one operation and the next double click reverses or performs the next operation?

So I have two separate batch files. One to disable the NIC and enable the wifi card: @netsh interface set interface name="Ethernet" admin=disabled @netsh interface set interface name="...
0
votes
0answers
5 views

Looking for software that can batch replace files (.pdfs) within a folder structure/directory [closed]

Im looking for software or possibly a script that can replace around 300 pdf docs from a folder structure with some new and updated ones (identically named). So for example, lets say I have a folder, ...
0
votes
2answers
21 views

Batch File; Run exe from Top folder of specified Directory

Question; Is there a way to direct this Batch file to the latest Version Folder (highest year) of AutoCAD 20xx found in the C:\Program Files\Autodesk\..? General Background; A number of staff run ...
0
votes
1answer
20 views

FTP script not transferring files to local computer

I'm running a batch file that calls a script from a text file but it's not retrieving the files I want. DownloadData.bat ftp -v -i -s:FTPscript.txt 192.168.50.50 FTPscript.txt username password lcd &...
0
votes
1answer
30 views

Move all files from multiple subfolders into the one folder

Basically this I used FOR /R "C:\Source Folder" %i IN (*.png) DO MOVE "%i" "C:\Staging Folder" It worked flawlessly except that all of the .png files that I have are ...
-1
votes
0answers
24 views

Need Help !! How to extract email address and password from text file using cmd or any? [closed]

I have a text file named file.txt Which contains, Email : wewewewewe@yahoo.com Password : kukukukuku Email : kokokokkoko@yahoo.com Password : mememememem I Want Output in mail.txt will be ...
0
votes
0answers
19 views

Bulk exif tags bat script not working peoperly

I have a batch script to set XMP:Subject Exif tags on pictures in bulk. tags.txt has all links of the pages and the tags. Links and Tags are separated by =. This script should divide the URL and Tags ...
0
votes
0answers
11 views

How to separate folder full of files by data before and after a specific line? [closed]

I have a folder full of text files in Windows. I'd like to separate every file in the folder into two parts, the first part containing all text in the file up to, and including line 9 of the file, and ...
0
votes
0answers
32 views

Will checking the last Modified Date of a WIN7 TaskScheduler file (StartRecording), by means of a batch file, automatically update it?

I'm aiming for a quick way to monitor the last Modified Date of a WIN7 TaskScheduler file for Windows Media Center - probably quicker by a batch file than by clicking down 7 levels in Win Explorer. ...
0
votes
0answers
29 views

Determine if an open application is minimized or maximized with batch script?

I am running a batch script to display a schedule on a machine HMI, my script displays the schedule in notepad and if the schedule has been updated I am deleting the current file and displaying the ...
0
votes
0answers
29 views

Color batch error output in different color

Is it possible to run a command, for example xcopy and have it's standard output and error output in different colors? I'd prefer using just what comes with Windows 10 without extra downloads. cmd or ...
1
vote
1answer
17 views

Can't open some programs like Telegram, through batch

For some reason, I'm having trouble opening Telegram through the use of a batch script. The above script, just opens the following CMD window: Tried searching here and there, but to no avail of ...
0
votes
3answers
55 views

Chain Powershell commands in batch file? (Windows)

I am running Powershell commands in a batch file to replace text. This works, but it runs an instance of Powershell every time it replaces something: :: Replace foo1 with bar1 start /wait /min ...
0
votes
0answers
35 views

Recursive PNGOUT for Optimizing All Images in a Folder with multithread

I'm looking to build a small batch script (for windows 10) that executes the command line of pngout.exe for all PNG files inside a folder. In another discussion I found this command: for /r %f in (*....
0
votes
1answer
32 views

Keep only lines in txt files that contain a certain word/character (Powershell) (Windows batch file)

I want to keep only the lines that contain the word example and remove all other lines. I thought this would work but it does the opposite to what I am trying to do: PowerShell -Command "gci *....
0
votes
2answers
173 views

How do I make a running and working batch file from a pre-made batch file?

So I am trying to make a batch file from a pre-made batch file and I don't know how to got to the next line in the file without ruining it and it just saying what I want the command to do. This is ...
1
vote
3answers
27 views

If not exist (*.*) not working on empty folder (Windows batch)

I don't think I have ever had this happen before. Using these commands: rem Check if any anything was downloaded... if not exist "%download_temp%\*.*" goto :fail_message if exist "%...
0
votes
2answers
31 views

Batch File command to unlock password protected archives

I'm trying to write a batch file that will unarchive .7z files...extracting them to their original folder. The problem I'm having is adding the password to the code. Can someone help? Thanks! Here is ...
0
votes
0answers
26 views

how do i boot from my pen drive whithout rebooting the system?

I have windows installed and a bootable USB drive which has live ubuntu 20.03 os. I just want to plug and boot to Ubuntu operating system without restarting or rebooting. how is it possible? any BATCH ...
3
votes
2answers
106 views

Unable to call ffmpeg in a batch file

I reencode a lot of video files with ffmpeg using the following command at the prompt: for %F in ("..\*.*") DO ffmpeg -n -i "%F" -c:v libx265 -c:a copy "%~nF.mkv" I ...
0
votes
2answers
49 views

Using Windows rename to replace a single underscore with a double?

Can anyone advise me where I am going wrong with this? I have some file names that contain XXX XXX_Layer_XXX and I'm trying to replace to XXX XXX_Layer__XXX My attempt so far was: ren "*Layer_*.*...
0
votes
0answers
18 views

How to set up Jenkins build error levels for stable/unstable

I have a Jenkins job which consists of two main build steps. First step runs the tests and the second step reruns failed steps again. First step is set up as "Execute Windows batch command" ...
0
votes
0answers
23 views

Batch move files form excel to to new

Is there a way to batch move files from excel to a new folder I have multiple folders with images about 30,000 photos but in all different folders in my computer and I have a list in excel of about ...
0
votes
1answer
39 views

Extract Information from Clipboard and return partial Information back to Clipboard

I'm need a small batch-file which should help me extract an Information from the clipboard an return a partial information to the clipboard. I have come so far: @setlocal enableextensions ...
0
votes
3answers
64 views

Confused about goto label (batch file) Windows

If I use these commands this way around, it does what it should: If foo was previously set as one thing or another, it skips to foobar_menu If foo was previously not set as (the same) one thing or ...
0
votes
0answers
22 views

How can i make auto input after a prompt in a batch file?

I want to automate my cmd line workflow, so I made a batch file and everything works file, but I am stuck at one step. How can I make sure to input a certain text after a prompt. I want to make a ...
1
vote
1answer
18 views

Overwrite folder with Xcopy

I have a backup folder that i should copy it weekly , so i use a batch file in the task sheduler of Windows contains this line xcopy /s "C:\backupMai" "\\myserver\backup$\logFile\...
0
votes
1answer
18 views

How to rename multiple uniquely name directories on a mapped drive with unique names in a batch file

I have a mapped drive with multiple uniquely named folders containing files. I want to rename each folder with a batch file. V:\Media\Elton John\Singles>dir Volume in drive V is DATA3 Volume ...
0
votes
0answers
14 views

Strange result for 'query user' in batch windows terminal server 2019

I've checked user's presence in a specific windows terminal server 2019 with the following command (prompt): C:\>query user /server:myterminal this is the result I've displayed. USERNAME SESSION ...
1
vote
1answer
78 views

How to get tab-initiated lines using Findstr /B [TAB] in Bat/CMD

There is an option that works in Unix & Linux: Like @jimmij answer command: grep -B2 '^\t' file. But is there an option using only bat/cmd with the Findstr command? Already tried.. Findstr /bl [...
3
votes
2answers
59 views

Breaking out of a batch file

Best title of which I could think. Here's the issue. I have one batch file that I use to give me a directory of user log files. I pass the beginnings of a user name to the file. DIR lists all the ...
0
votes
0answers
10 views

Grouping windows taskbar batch file shortcut and the program it's running in Windows 10?

I've a shortcut pinned to my toolbar that runs a batch script which executes the below command: runas /user:USER /savecred "c:\windows\system32\mmc.exe C:\aduc.msc" When it launches it ...
0
votes
2answers
21 views

Batch File: Search All Directories Except These Directories

I have a line of code that looks like this, which loads all immediate directory names into Variable A, then continues on through the rest of the loop. for /d %%A in (*) do How can I change this such ...
0
votes
0answers
15 views

batch script create columns based on amount of files

I have a .txt-File which should be extended based on how many files there are in a folder. The .txt-File looks like this: --------------------------------------------------------------------------- ...
2
votes
1answer
43 views

Remove all trailing white space with powershell in batch file?

This works to remove one white space from the ends of all lines in all txt files next to the batch file this runs in: start /wait /min Powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "...
1
vote
1answer
32 views

Batch copy file with current date in file name

How to copy files from one directory to another, whose names contain current date, and so the names change daily. Example: File name: Test_14042021.txt Date today: 14/04/2021 // DDMMYYYY I tried this,...
0
votes
0answers
27 views

Making a Batch File a Service stops Taskkill from working?

I have a batch file that checks to see if a program is running and will kill it when the requirements have been met. It works just fine when I run the .bat file via cmd, but when I make it a service (...
0
votes
0answers
24 views

plink is not returning prompt , hanging over a command. How to return/ break the execution?

I am new to batch scripts. I wrote a script which runs commands like tcpdump using plink over a remote host. after execution of tcpdump, plink hangs for long time and does not return anything. Script ...
-1
votes
0answers
48 views

Remove a specific character if it's at end of a line (replacing text using powershell in batch file)

I have lines of text with a double quote at the end and want to remove only the double quote character, only if it's at the end of a line. Is this possible in powershell in a batch file? Cheers.
0
votes
0answers
36 views

I need taskkill to end just one instance of a cmd process

I want just one cmd, commandline window to close automatically and allow the other of the two cmd windows to keep running. My first cmd window is launched by a batch file. This open cmd window running ...
1
vote
1answer
46 views

Escape back slash next to double quote in PowerShell failing

I'm running PowerShell in a batch file to replace characters and I'm stuck trying to replace instances of \" with ". \ on its own can be escaped by doing \\ " on its own can be escaped ...
1
vote
1answer
28 views

Is there a command for setting unbuffered stdout and stderr in Windows batch?

I want to setup a command with unbuffered stdout and stderr. In Unix system, it can be achieved by using stdbuf -o0. For Python scripts, it can be achieved by using python -u. What is the equivalent ...
0
votes
2answers
35 views

Trying to escape double quote next to comma in powershell, usual method fails

I am replacing text using powershell running in a batch file, using single quotes to enclose the text to be replaced. I have found that trying to escape a comma followed by a double quote, can't be ...
0
votes
3answers
80 views

Multiple IF-Else Conditions in Batch-File

Recently I asked a question about how to use a if-else-Check in a batch-file which got solved. Now i tried to Expand on that by using multiple if-else-conditions in my batch-file. When executing it, ...
0
votes
1answer
30 views

Copy some information of logfile with specific date

I want to copy some information from a log file of PC in my company for a specific date, the remote PC has a Windows account with a password. I try to share the folder to have access to this one but I ...
0
votes
1answer
128 views

Error when using powershell with “%%G” and “%%~nG”

I'm trying to run the below powershell command in a batch file to replace a text string in all txt files, but I keep seeing the error "a positional parameter cannot be found that accepts argument&...
0
votes
0answers
5 views

Can I Import XML file to the Task Scheduler with a batch command? [duplicate]

Soo I need a fast way to import a XML file into the task scheduler and i need a batch script I tryed this: schtasks.exe /Create /XML F:\scedule.xml /tn scedule But it does not work. Help pls
0
votes
1answer
55 views

Cut off start and end of mp3 file with ffmpeg - without having to specify file duration? Windows batch

I have hundreds of mp3 files, all random lengths. I want to cut 10 seconds off the beginning and 10 seconds off the end of each file - without having to tell ffmpeg the duration of each file. Here's ...
1
vote
2answers
48 views

Why does the Windows Batch script output the variable as “ECHO is off.” instead of the actual value

I have written a Windows batch script to create an array and tried to print every element of the array. However, the output is ECHO is off. instead of the actual value such as "Apple". When ...

1
2 3 4 5
69