Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
23 views

Is there an autoexit for cmd.exe like there is an autorun?

In windows when you create a value autorun in registry key HKEY_CURRENT_USER\Software\Microsoft\Command Processor and set it to, say, echo Hello from autorun, invoking cmd.exe will, on invocation, ...
-1
votes
0answers
15 views

Rename a subfolder and apply attributes to it in batch? [on hold]

Alright, so all i'm trying to do is rename a subfolder in a folder with a .bat file. The line looks something like \tests\Area51\Sector1 and the .bat file has to be in the tests folder. I've ...
4
votes
1answer
51 views

Failing in batch powershell

I have a powershell command that runs fine. $(Get-Item c:\0\01.txt).lastwritetime=$(Get-Date "01/22/2002 11:11 am") I'd like to use it multiple time. Using a batch file. Before the batch file I used ...
-1
votes
0answers
22 views

Custom PING.EXE or Batch [duplicate]

I would like to make my own custom ping command using batch for windows, I can upload my script if you would like to see, but my main question is how can I alter what the result of the ping is. For ...
0
votes
1answer
25 views

Batch move subsubfolders & files by up a level

I have a directory that looks like this Root Folder - Folder A - Subfolder - File1 - File2 - File3 - Folder B - Subfolder - File1 - File2 - ...
0
votes
0answers
11 views

Get middle of file name with three periods? batch code [closed]

I have file names that look like randomstring.randommiddlestring.1234. If it is already in a string, how can I extract the middle portion of the file name to a separate variable?
0
votes
1answer
15 views

findstr test if contains characters other thank given batch

I have a batch script where user input is needed. However, I only want to allow a-z, 0-9, @#$].~+-=_/\:;. Is there a way to use findstr to make sure there are no characters other than those? I've ...
-1
votes
0answers
18 views

Associate many filetype [closed]

I have script for change file type extensions and changed all filetypes but TXT without only. @echo off rem --> Check for permissions >nul 1>nul 2>nul "%SYSTEMROOT%\system32\cacls.exe" "%...
0
votes
0answers
15 views

Batch Script or alternate script [duplicate]

I'm not sure if this is the correct platform to ask on but here I go. I'm working on windows 10. I have a lot of files generated into one folder from a script with different parts to the name. I ...
1
vote
1answer
23 views

Need to allow standard users to run sc stop/sc start commands for e1iexpress

A persistent problem we have is that on our computers, our internet drivers crash when laptops move from place to place. In theory, we could solve this by giving the users a script to restart the ...
1
vote
0answers
14 views

Batch script to launch an application and insert file name and then replication

I want to run the "mIRT-PP" program, and put in file names on the cmd screen. The format of the program is as follows. When I run the "mIRT-PP.exe", 'Control card file name:' will pop up on a cmd ...
1
vote
2answers
63 views

Can delete a file through windows explorer but not through batch file

When trying to delete a file from a network location via windows (I am on windows 7) batch file using a "del" command with /f and /q flags, I see an "Access is denied." message, and the file is not ...
2
votes
1answer
20 views

How to mkvmerge all videos and subtitles with the same file name

I have a folder containing different video and subtitle types, with each set of videos and subtitles having the same file name, and some videos with no subtitles. For example, video01.mp4 video01....
2
votes
0answers
20 views

Using SendKeys to move windows through a batch script

I am trying to learn how to script on Windows 10. I thought a good first project would be a startup script for my work computer. Basically, I have a .bat that starts all the webpages I use regularly ...
0
votes
1answer
17 views

Trying to use wildcard in IF statement

I'm trying to execute some commands based on the machine hostname but am having trouble getting it to work. I want the command to run only if the hostname starts with "Machine". Do IF statements ...
1
vote
0answers
82 views

How do you kill a tree using taskkill /T in CMD, but exclude some process in the tree? [closed]

I want to terminate explorer.exe's tree in a batch file and continue with its commands, but it seems to kill the batch file also. I was wondering if I can exclude the processes that CMD/ the batch ...
0
votes
0answers
47 views

How to make Output filename template for youtube-dl using batch file window?

I ran command in command prompt which work like charm. youtube-dl -o "D:\yt\%~1\%(playlist)s\%(playlist_index)s - %(title)s.%(ext)s" --batch-file=ylink.txt Now, I want this command to execute from ...
0
votes
1answer
22 views

*NIX getopt alike for DOS

I want to write a DOS script with multiple optional option flags. I have to parse these optional options. An example: get_resolution.bat /? get_resolution.bat /h input.jpg get_resoltion.bat /v ...
0
votes
1answer
70 views

What is wrong with this for loop in my script?

K:\bin>type get_date_without_space.bat SET DATE_WITH_SPACE=%DATE% FOR /F "TOKENS=1-2" %I IN ("%DATE_WITH_SPACE%") DO SET DATE_WITHOUT_SPACE=%I_%J ECHO %DATE_WITHOUT_SPACE% This doesn't work. Why? ...
2
votes
0answers
50 views

Terminating a Process from CMD: Softest to Hardest

I was wondering if anyone had experience using command line to terminate processes using taskkill and WIMC. I was wondering if anyone knew the order of how "hard" of a close/terminate these commands ...
0
votes
1answer
42 views

Need Batch File/Script To Find Multiple Usernames Using Their Machine Names [closed]

I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines. I can do it individually using the following command. But I'm not looking to do this 200 ...
0
votes
1answer
102 views

Script on Ending Process according to memory consumption windows 10

I am looking for a batch or powershell script that if memory used by a process is less than 10 MB end that process and restart it.I tried searching a lot,but i could not find a ultimate solution. ...
0
votes
1answer
73 views

Batch File, dir | findstr within a for loop

Let me preface by admitting that I am a complete noob at batch files... and programming language in general. I am trying to write a batch file that allows the user to input a partial filename, and it ...
0
votes
1answer
79 views

Maven command into bat

I must run a maven project from command line with this command and works fine: mvn -Dexec.args="-classpath %classpath com.mycompany.serverrds.serverMainClass" -Dexec.executable="C:\Program Files\Java\...
0
votes
1answer
42 views

Command prompt handle to run commands in specific command prompt

I have a utility abc.exe that launches a special command prompt. By special I mean, certain environment variables are set on that prompt. Next I have to run a set of commands on this special command ...
-1
votes
1answer
26 views

Batch File Help : Not able to store the values parsed from .csv file to variables

I have a .CSV(Comma separated) file, from which I need to extract the values at specific columns and then I need to substring those values. The substring values should be written in output file. ...
0
votes
1answer
40 views

How to copy Folder directory including Root volume folder on Windows?

I would like to copy Recursively the full C:\Test Folder with all subdirectories including the Test folder and the folders permisions. I tried using the following commands but it only copies the files:...
0
votes
0answers
36 views

Complex Multiple folder batch files - level 3 sub folders

I am looking at setting up a 3 level folder structure for approx. 5500 'assets' with each level 1 folder containing multiple (13) level 2 subfolders. I have managed to get this far using the script ...
0
votes
0answers
20 views

Batch that can close a tab web explorer

I am doing a script in batch that downloads the last version of 2 files from a share point. My issue is that it opens a tab in google chrome and I don't want to see that so I would like to close it. ...
1
vote
0answers
53 views

Batch Banner colored only

I would like to have the banner that I call always in red let's say and all the other text be white. How can I do ? Thank you. :BANNER CLS echo ___ _ _____ echo ...
0
votes
0answers
63 views

Execute two differents files with a batch file

My Effort I've been at this for about 3 hours of playing with the virtual desktop combinations with Rainmeter and I'm a total newbie at scripting logic. I'm having trouble figuring out how to make it ...
0
votes
1answer
16 views

Would a reg command run from a batch file require admin perms?

Would something like: reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /v %keyname% /t REG_SZ /d "%expath%" require administrator privileges to be able to execute from a batch file?
1
vote
1answer
44 views

Windows Batch-File to execute and communicate with running program

(How) can a program with interactive command line mode (shell) be programmatically "interacted" with from CMD.exe via batch file (.bat)? Example: >program.exe >>aCommand >>...
1
vote
0answers
33 views

Error level always 0 in batch file [duplicate]

I'm trying to set up an automated deploy script from a windows image. During testing, I'm running into an issue regarding the the part that tries to catch if something went wrong with certain commands....
0
votes
2answers
40 views

Find folder using batch

I'm trying to make a script that helps to go through a big library with lots of folders, names and numbers. The part numbers are divided in 4 parts XXX.XX.XX.XXXX. To help the searching the library ...
0
votes
1answer
65 views

Encrypting the password value used to send an email via a bat file?

I want to send a file to my Gmail account via a bat file and encrypt my email info in that bat file so that if someone opens the bat file they cannot get the email information from it. My Script I'm ...
2
votes
3answers
56 views

Batch Conversion of different files in a folder to PDF

I need a Linux command-line instrument that can make scripted conversion of files of different format (usually .odt, .docx and .rtf) to PDF. How would I do that?
0
votes
1answer
59 views

How do I check what a txt file contains, and if a fixed number of the last characters match a variable, then delete those who match?

I have a batch script that need to check what a textfile (.log or.txt) contains. When it's done checking, it needs to delete those lines that contain the same configuration of charachters that is ...
0
votes
0answers
33 views

Batch Program to play all music by groove

Please help me to play all populated music in Groove Music by a batch program with a click. The following code only opens Groove Music start mswindowsmusic: and the following code plays only the ...
4
votes
2answers
604 views

How do I check if the three last characters of a variable match another variable?

I have %var1% and %var2% var1="UserInput" var2=file.log If a user types %var1% as "file.txt", how can I (if possible) check only the three last characters (Or the file format if that's possible) to ...
0
votes
2answers
53 views

How do I only copy a file, then manually navigate to another destination, and then paste it. (Without a fixed path)

I need to move a file from one directory to another without any fixed paths in the copy/paste command. That means I likely cannot have a one-liner copy/paste command: The folder structure is as ...
0
votes
1answer
58 views

Migrating our startup scripts from CMD batch to Powershell?

My team builds an on-premise application that works on Windows, Mac and Linux. The application contains a bin directory with the startup scripts for the application. bin startup.sh (for linux/mac)...
1
vote
1answer
39 views

Batch file: Run command and loop at same time

I want to run a simple batch script that basically includes only two Wireshark commands: @echo off dumpcap -i 1 -f "tcp port 8800" -a "filesize:100" -n -w "data.pcap" && :loop start tshark ...
0
votes
1answer
16 views

batch command line that duplicate any folder inside a parent folder and copy it to original folder

Example: I running window 10 and I have a parent folder that contain 3 folder: A, B, C X/A X/B X/C I want to duplicate 3 of them and copy each of that copy folder into the original folder. Ex: ...
2
votes
1answer
39 views

How to check whether a folder is open or process is being run in windows explorer in cmd?

I'd like to write a .bat file that opens multiple folders if none of the aforementioned folders or files are open, and closes all of the multiple folders if any of them are open in Windows Explorer or ...
1
vote
1answer
49 views

How can I batch process Camtasia Studio's .camrec files?

I have several Camtasia Studio's .camrec files. I would like to convert each of them to a .mp4 file, using the same conversion settings (audio/video encoding parameters, etc.). How can I achieve that ...
0
votes
1answer
35 views

Batch file not working

I am trying to run some commands in batch file on windows server 2012 but it's not working properly. What i am doing here. Get all files(.docx) from current directory in loop, convert file into pdf ...
1
vote
1answer
55 views

batch change date of all files in dir based on name order [closed]

I have a lot of images sorted according to their filenames: img1.jpg, img2.jpg ... I need to change the file date which is now the same on all images so that img1.jpg date is before img2.jpg etc I ...
0
votes
1answer
30 views

How to open Windows+Tab in command prompt?

From a batch file, is it possible to open the Desktop view like when you press the Windows Key and the Tab Key? Preferably in one command.
0
votes
1answer
198 views

Send a file to an email address using a bat file without exposing the email info?

I want to send a file to my Gmail account via a bat file and encrypt my email info in that bat file so that if someone opens the bat file they cannot get the email information from it. Logic such as: ...