Most voted "bat" questions
A file with extension . bat can be defined as a set of commands executed in batch (sequentially). Created for MS-DOS has the function of automating routine and often laborious tasks.
Learn more…50 questions
Sort by count of
-
13
votes4
answers3721
viewsList files by name (containing date), but filter the 5 days prior to the current date with . bat?
I’m trying to do something that maybe it’s not even possible to do in bat but specific using findstr? I have a dozen files in that layout: filename So, date as day and month content two digits and…
-
5
votes1
answer5532
viewsIn a file . bat (Batch) how to rename a file using variables such as %userprofile%?
I am wanting to rename a file that is found on the Desktop using batch script. The only line that’s going wrong is this: rename "%userprofile%\Desktop\Lista.xlsb" "%userprofile%\Desktop\Lista -…
-
4
votes2
answers170
viewsComputer architecture with bat
You have the following bat code: if %PROCESSOR_ARCHITECTURE%==X86 (echo 32 bits) else echo 64 bits This code takes the architecture of the processor, but I wanted to take the architecture of the…
-
4
votes1
answer1017
viewsCreate File Name with Day of the Week
I need to create a routine that does the backup with the name of day of week in order to comply with the following layout: Example: backup_01012019_second.7z The closest you could find that didn’t…
-
3
votes2
answers402
views -
3
votes2
answers3180
viewsFinish process and open again by . bat
My problem currently is the following, I have an executable that has the function of employee access control, but due to some problem in this process it usually stops responding, with this I built a…
-
3
votes1
answer1023
viewsHow to create a . bat file directly from C#?
I am making a program in C# and in it I run a file . bat Look how I turn the file: string batDir = string.Format(@"C:\Users\Desktop"); proc = new Process(); proc.StartInfo.WorkingDirectory = batDir;…
-
3
votes1
answer87
viewsShutdown the computer when a particular program shuts down
I’m turning an old CPU into a Minecraft server. When turning the computer on, I can get it to open the server via script (starting a -jar file), however, I would like to have it shut down as soon as…
-
2
votes2
answers585
viewsDelete file with name and path in other file. bat
I need to develop a batch that has to read the data in a.txt file, and according to the path and name of the file I have in txt a batch has to go to the folder and delete files. The data I have in…
-
2
votes1
answer291
viewsFfmpeg and BAT Automatic Conversion
I am using ffmpeg to convert all videos from one folder to . mp4, and for that I have created one . bat to make the process, but, the problem that is next: When it starts the conversion, it creates…
-
2
votes2
answers1693
viewsHow to remove accent using bat/cmd
How to create folder using a user name without special accent(s) or character(s)? Like, for example, changing càmbio for cambio Is there a command that converts this? Thanks!…
-
2
votes1
answer124
viewsGenerate a pop-up window in R
I have a code in R that generates an output message stating whether a series is updated or not. I run the code through a file. bat on Windows and it generates a txt file. I tried to generate a…
-
2
votes2
answers166
viewsHow to create the boolean AND condition in a . bat code?
I have a simple program that deletes certain files if they exist, but I would like to improve it using a boolean condition in case the two files do not exist. Is it possible simply? I found answers…
-
2
votes1
answer110
viewsScript help . bat does not read spaced words
How to make the script work? Basically it reads names that contain in.tag Ex files: file1.tag, file2.tag... after reading these names it searches by name in one or another.txt file that contains all…
batasked 3 years, 11 months ago arthurvalenca 49 -
1
votes3
answers1106
viewsDoubts with conditional commands in Batch files
The Intent is to copy files .jpg to a subfolder called \image, and the others, I mean, different files from .jpg, to the folder \New folder (2)\. Only it’s not working, which could be wrong? Below…
-
1
votes1
answer286
viewsRepeat loops with conditions seem not to work
Obs.: I believe it is error in the variables, because the loops do not work. This code stores the average execution time of backups SQL of the month and uses this time to limit the execution time of…
-
1
votes2
answers597
viewsHow to enter data at runtime?
I would like to write while running a bat file. I have to enter user and password after executing a command. When executing the command I have the following output : Você foi direcionado com…
-
1
votes1
answer88
viewsHow to rename multiple . mp3 files by replacing the first argument of each one’s name with a sequential order of numbers
Imagine we had these files in a folder: 2 arquivoABC.mp3 1 arquivoCBA.mp3 3 arquivoBAC.mp3 0 arquivoBCA.mp3 So how could we make the names stay that way: 1 arquivoABC.mp3 2 arquivoCBA.mp3 3…
-
1
votes0
answers19
viewsAutomatic Startup of Programs
Well, I have two programs one written in JAVA that queries a database and and generates an xml, and another written in C++ that traverses the xml generated by the java program. I wonder if there is…
-
1
votes0
answers136
viewsMonitoring Ping . BAT
Sorry, guys, I’m a total layman. I need to create a file. Bat that after inserting an IP. It monitors the ping and emits a log in case the device stops responding with date and time in a TXT file.…
-
1
votes2
answers33
viewshow to delete the. bat file I am using
I’m trying to play a little game with . bat, it works like this: I ask a question, if the player hits he continues the game, but if he misses deletes the game file. But I don’t know how to program…
batasked 3 years, 10 months ago Anonimator 11 -
1
votes0
answers37
viewsInvalid character in R
I turn the [ ] character into an A letter, within a R data.frame. It works perfectly, though, when I create a ". bat" to run this algorithm automatically by windows tasks it displays the following…
-
1
votes1
answer50
viewsUpdate Application Version Automatically - Cordova
The script below saves the version to a txt, however is giving some error that in the file txt appears as : "ECHO is disabled". @ECHO OFF CALL npm version > version SET /p ver=<version DEL…
-
1
votes1
answer35
viewsCreate a . bat <source>"filename_2021_01_10_code" <target> another server
I created a .bat that was functional and there was the need to modify to select and copy files by the month of each current year for a Storage. File name:…
-
0
votes1
answer251
viewsRestore Postgre . BAT
I’m making a .Bat for Backup and one for Restore of a bank in Postegresql, the .Bat Backup works perfectly, however, Restore gives problem by database owning data. Would have some way to start the…
-
0
votes0
answers145
viewsRefusal of accent with . bat
I have a . bat that when executed calls a script. My problem is that the files that are called by the script have "ç,á," type accents, things like that. So when he looks for the file, he can’t find…
-
0
votes1
answer715
viewsHow to list only document name and date using dir command?
How to generate a csv file listing only the name and date of the files within a given directory. Since there is no option in the command dir, that generates me an output with only this data. Most…
-
0
votes1
answer422
viewsEdit text file in cmd
I have a test.txt file D:\Tools\fonts D:\Tools\gui D:\Tools\guitex D:\Tools\table is there any command that edits the test.txt file to be this way? command###D:\Tools\fonts command###D:\Tools\gui…
-
0
votes1
answer390
viewsbat script to restart onedrive. Does it work?
The scenario is that I have some computers without user interaction where I use the Onedrive to back up at dawn With some frequency the Onedrive lock, so I decided to make a bat, very simple, to…
-
0
votes1
answer1161
viewsHow to find a file without specifying folder/drive in bat or moon?
How to find a file and save it in a variable? I will use it for reading (this part is already solved), however, I want to locate without specifying folder/drive, for example .\Arquivo.txt. I’ve…
-
0
votes1
answer958
viewsHow to run bat file by Delphi
Folks I am trying to run a bat file that is in the same exe folder, however I tried it in several ways and it does not run. WinExec('startNodeJS.bat',SW_SHOW); It does not run the bat, this bat is…
-
0
votes1
answer345
viewsIF to set default printer via batch
We are redesigning the machine park here of the company and the new machines came with Windows 10, unlike the Windows 7 that we used before. The first problem we had was with the way Windows 10…
-
0
votes0
answers78
viewsCreate a. bat file to delete information from a given table in postgresql
I am trying to perform a delete in postgre via bat file, I need it to be so due to a particularity of the system I am adjusting. However, I run the file and it doesn’t delete, I tried including a…
-
0
votes1
answer89
viewsUse . bat cls command in Java language
I have a code to start a session at Putty, with an IP address for a piece of equipment from each city. Inside the java code, I use . bat commands, for example the |CLIP command and start Putty.…
-
0
votes1
answer305
viewsAutomate script execution R
There is a script in the R link that works perfectly in Rstudio. To automate it, it runs every Tuesday at 15:00, I decided to create a file. bat and schedule its execution by the task scheduler,…
-
0
votes1
answer55
viewsDOSBOX does not recognize some batch script commands, how to resolve?
I was making a simple script in batchand testing with Windows 10 CMD, and it ran normally. However, when trying to run the same script with DOSBOX, the system gave error in the use of GOTO, yielding…
-
0
votes1
answer33
viewsHow to send the results of multiple Findstr commands to only one.txt file?
I’m creating a bat which has several commands "Findstr" How can I send the multiple results obtained by the commands "Findstr /i /c:Strings for the same arquivo.txt? dir/s/b C:\Users >…
-
-1
votes2
answers158
viewscreate a bat file
I need to create a file bat to change the network card’s ip and then open the cmd with a few command lines. In this case it would be something like this: Change the ip Open the cmd Place necessary…
batasked 5 years, 10 months ago Daniel Moço 29 -
-1
votes1
answer322
viewsHow do xcopy copy a directory from a variable
I’m with a project involving bat más I need to use a command (xcopy) Suppose: I want that I can enter the whole directory ex: C: Users "User" directory and be able to type in the destination ex: D:…
-
-1
votes1
answer49
viewshelp with bat scripts
I have a script for separating csv files, what the script does and open the file and model the columns, would like to know what I can change in this script to create a last column and repeat in the…
-
-1
votes1
answer16
viewsHow can I delete Regedit records that in the directory contain the serial "SID" by a file. bat
I’m trying to create a file .bat delete specific records within Regedit that works on any computer. When I try to delete the records inside the directory (Computer HKEY_LOCAL_MACHINE SYSTEM…
-
-2
votes3
answers262
viewsBatch programming
I would like to make a batch that does the following count: Read the source file: 7895537000011 7895537000028 7895537000035 7895537000042 7895537000059 7895537000066 7895537000011 7895537000011…
-
-2
votes1
answer505
viewsHow can I answer a completed cmd question?
I am automating a process through a file. bat and at a certain point the cmd gives me a question, I wonder how can I do to answer. I tried to: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1…
-
-2
votes3
answers1086
viewsSelect "Open with" with . bat command
I need to open any image through Windows image viewer (what is standard of Windows 7), but I’m using the Windows 10 and I can’t change the system’s default application to no longer use that App…
-
-2
votes1
answer1094
viewsWhat is Batch Script?
I started studying about Batch and a question arose in my head about whether or not he was one programming language. I did a search on the internet on this subject and some people say no, others say…
-
-2
votes1
answer113
viewsCommand findstr no cmd
Hello, I made a bat to print information from inside an xml file (Posversion.xml) only that it only gives me the line information I searched and does not tell me which machine that file belongs to.…
-
-2
votes2
answers185
viewsA bat that copies a file to a folder named after it
Hello, I’m trying to create a bat that copies a file from a folder and creates a folder with the name of that file, and plays that file inside it but it’s not working very well and I need help @echo…
-
-2
votes1
answer33
viewsAdd value of a variable in a record
I created a bat to add a file content to a record value, but I can’t get the contents of the play variable in the value. This is my . BAT @echo off setlocal EnableDelayedExpansion If exist…
-
-3
votes1
answer26
viewshow to create a . bat that creates another . bat with more than one command?
i want to create a file . bat creating another file . bat, but when I try to create I can’t put more than one command. example: I have my test.bat file that will create another file called…
-
-5
votes4
answers1004
viewsWhat are the batch commands/variables. Example [%username% or %groupname%]
How to get more information about variables of this same type/model? Is there any publication (link) with more information related to these variables? I need to get as much information from the…