Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

1
vote
1answer
23 views

How can I make two files open automatically in a .bat file?

The following commands are in a .bat file. "C:\My folder\123.txt" "C:\My folder\456.txt" After double-clicking on the .bat file, '123.txt' will be opened but '456.txt' will not until I manually ...
0
votes
1answer
19 views

Is there a way to write a Batch-file which will Return services into their Default mode?

I had already twice a problem with my computer were it just went out of controll and most of the functions were incontrolable, including services like Sound, Brightness, Internet and some other. Later ...
0
votes
1answer
22 views

CMD Batch file virtually press the enter key

I am working in a manufacturing company. We manufacture PCB for HDD. Each PCB need to be loaded with firmware in manufacturing process. I would open the application the i would browse for the suitable ...
1
vote
0answers
29 views

Batch file using icacls not executing

I'm reading the users from a file and I try to grant them access to a specific folder, but when I execute the batch file below nothing happens. Can someone please explain me what is wrong? Edit: I'm ...
0
votes
0answers
23 views

Put a new string of characters on a new line after each line break after every new string in a text file

I need to put a new string of characters on a new line after each line break after every new string in a text file. It is a large list of website addresses that are only seperated by one space on one ...
1
vote
1answer
27 views

Writing file with batch but text is disappearing

I have a problem with writing a file with a batch file. It seems that one character is triggering the echo end like this one: the code is a downloader. C:\ProgramData\Tempfolder\test.vbs ECHO if ...
0
votes
1answer
22 views

Adding current folder as a prefix to file name without duplication

I'm trying to piece together a batch file that will add the current folder name as a prefix to all files within that folder. In addition this needs to be able to run multiple times without duplicating ...
0
votes
0answers
20 views

Delete folders with exclusion on Windows 8.1

I am not that great in coding hence need your help. I have used RD with /s/q for removing the folders that I don't need which is simple because I know what folders to remove but I got a new situation ...
81
votes
5answers
6k views

How can I remove a forkbomb from the Startup folder?

I have an older laptop running Windows Vista, from about 2005, and I was fooling around with it, and decided to make a Batch file and put this in it: %0|%0 I ran this, and obviously, I had to ...
2
votes
1answer
42 views

Output each commands results into a separate file

I have got the following script which executes a separate step one after the other: @echo off set /p guid=Please enter GUID: start /wait Drop\Debug\Ylp.Web.CmsImportWebJob.exe /test map %guid% start ...
1
vote
1answer
16 views

XCOPY can't read /EXCLUDE file

I'm trying to write a build script batch file for an Unreal Tournament 2004 mod I want to publish the source code for. This script contains a call to XCOPY with the /EXCLUDE parameter as follows: ...
1
vote
0answers
36 views

How do I keep WZZIP from creating a zip that makes a folder when unzipped?

I'm looking at an automated process (utilizing a "DOS" .BAT file) that creates zip files with a simple command like... wzzip [path][zip file name] [files to be zipped] "[files to be zipped]" ...
1
vote
2answers
25 views

Is it possible to remove certain files types from certain folders using wild cards. within a command prompt / batch file

I have a files I need to remove within a certain file structure from a certain directory but have multiple directories but within the structure there is a defining folder. e:\archive\ *\3 WIP\ *...\ ...
0
votes
1answer
39 views

can I paste code after opening notepad from cmd

I have written below given query and opening notepad from cmd, but even I want few things to be pasted when this notepad opens. These things will be in my initial notepad and once I run this bat ...
-1
votes
0answers
10 views

Change Directory to Folder whose Folders above it Change per Installation

So this is a bit of a weird one for me. We have this program that installs itself like this example: C:\users\user\appdata\apps\variable1\variable2\programfolder The problem i'm running into is that ...
0
votes
0answers
23 views

Cannot connect RDP on first try if running via bat or task scheduler. Works if done manually

I'm currently on Windows 8.1 using a TermServer wrapper to enable self RDP connections. The idea is running a Kiosk like system that loads up a single front end, then provides a separate profile ...
3
votes
1answer
351 views

Create Batch file to copy one folder and then generate it 1,000 times naming it 'AE 0001' up to 'AE 1000'

I've had a look around, and I found some stuff that kinda worked, but I'm new to all this batch stuff. I'm looking for a batch script that will copy one folder and everything in it. The folder is ...
0
votes
0answers
19 views

Syntax error on setting variable in bat file

I'm trying to set up some variables in my batch file to later echo them into files. I get a a syntax error on a line of code almost identical to another line of code that works just fine. ... SET ...
1
vote
1answer
30 views

Running a custom batch file on keyboard shortcut in current directory

I'm developing lot of small .esb services recently and I'm pretty tired of doing Shift+Right click to open cmdin current directory then typing mvn clean install. What is the easiest way to run simple ...
-1
votes
1answer
27 views

How can i compressed(winrar) a file using command prompt and the file name of the .rar is the same with the file

i have a autoback.bat file that will automatically backup my database and compress in using winrar application. the problem is i cannot create a rar file that is the same filename of my database. for ...
0
votes
1answer
34 views

Opening .bat file in CMDER instead of default CMD

I want to associate .bat files with another console emulator, named cmder, so that when they are opened they must start up with my preferred program. How to do this? ps: I'm using windows 10.
0
votes
1answer
38 views

Preventing program execution with batch file

I am running one batch file in loop continuously. While this .bat file is running it should not allow one particular executable to run. How can this be achieved? Can that particular executable be ...
0
votes
0answers
71 views

How do I execute a program on a virtual Desktop using cmd

I am looking for a command that lets me open a program on a Virtual Desktop in Win 10. I need that command for a batchfile I am writing, if you got another workaround (like multiple commands doing ...
0
votes
1answer
34 views

How to delete lock file if service failed to start

I have a service that has its Startup type set to automatic. However, during an unexpected restart, this service failed to start because of existing lock file. How can I delete this lock file ...
-1
votes
1answer
42 views

Need help finishing a batch script to rename files

i am writing a script to rename files based on date. Files are generated every day from a server outputing them like this: fil150807102600000001.txt fil150807102600000002.txt ...
0
votes
1answer
28 views

Batch File - Does Directory Exist - If so, delete

Having an issue with if-else statements/error handling. Been trying to get this to work, cannot seem to do it. What I'm looking to do is have user input client id, then delete the directory ...
0
votes
0answers
47 views

Login Batch File Script Not Running VBS Files

I have a single login batch file for my users in group policy user login scripts. It is running when they login, but the vbs files I call from within the batch file do not appear to be. As a simple ...
0
votes
1answer
18 views

USB Auto Find and Copy

How would someone write a program that when one plugs in an USB, it would auto run, find file names and copy them onto the USB? I have tried it several times with varying degrees of success but never ...
0
votes
1answer
31 views

Batch file to only copy new files from source to destination [closed]

I am trying to create a batch file that copies only new files to another folder. I have .png files that come in through FTP at various times throughout the day. So I am looking for a .bat that I can ...
-1
votes
2answers
19 views

How to command cmd using batch file?

I would like to make a batch file that: 1.open cmd.exe 2.command cmd to open a directory. 3.make a new directory by using command mkdir inside the cmd. How can I do this?
1
vote
1answer
45 views

How to merge folders of the same name when moving without loosing data in any folder, in Windows 7 ultimate x64?

I use Windows 7 Ultimate x64. I want to move folders from my C drive to my D storage drive to save space in C. When the box comes up that asks if I want to merge or replace or skip moving a folder ...
0
votes
2answers
35 views

Why doesn't my IF ELSE work?

It's a simple script I wrote, nothing fancy at all @echo off echo 1 = stream1 source echo 2 = stream1 high echo 3 = stream1 medium echo 4 = stream1 low echo 5 = stream2 source echo 6 = stream2 high ...
0
votes
0answers
17 views

Batch command to delete users not on a list

Is there a way to delete users not on a list in a .txt file? Say I have the following on my system John Peter Mike Bob Now only John and Peter are on the authorized users .txt file John Peter ...
0
votes
0answers
9 views

loop for path name with space fails

I have problem with looping through file which path name contains space SET MPATH=\\server\path\some folder with space\Sample.txt for /f %%a in ("%MPATH%") do (set file=%%~fa) for /f "skip=1 ...
1
vote
1answer
41 views

Count number of lines in file using batch

I am using TrailerCount.bat file to count the number of lines in text file using below mentioned code @Echo off ::set newline=^& echo. SET FilePath=%1 Set /a _Lines=0 For /f %%j in ('Type ...
1
vote
3answers
524 views

What does hyphen mean in Windows batch file?

In particular, I have problems understanding the hyphens in the following lines, which are from wikibooks if not -%1-==-- echo Argument one provided if -%1-==-- echo Argument one not provided & ...
1
vote
2answers
137 views

Escaping the < sign with ^ does not work in .bat file

I'm trying to write a batch file that can generate some XML config files, but escaping the < and > signs does not seem to work. At the start of my script i wrote a test: SET ...
1
vote
1answer
125 views

How do I use VLC Command Line In Windows Batch Line Without Showing GUI?

I want to use the following to convert some M4A files to MP3. It works fine, but it displays the VLC GUI for each file and shows 'quit' as a second file to be converted. Is there a 'silent' mode, ...
0
votes
1answer
30 views

Search and replace “overwrite” bulk pdf files back to a directory tree in Windows

I have hundreds of PDF files I used an application to apply watermark to, however, the application only succeeded to apply watermarks by applying a copy of each pdf file off the directory tree and ...
0
votes
2answers
44 views

How do I rename multiple files on Windows? [duplicate]

I have 2800 files, all of whose names start with a four-digit number followed by " - ", and I want to delete all those leading numbers from all the files, leaving only the alphanumeric file names1.  ...
0
votes
0answers
39 views

Batch copy files from client list to my server

Could you help me to create batch file to get information from client to server. I have 10 clients such as 1. CU01 2. CU02 3. CU03 . . . 10.CU10 I would like to copy file from 10 clients on ...
1
vote
1answer
58 views

.bat file to run and stop a background process in windows

I want to bundle two simple windows bat files with my PHP app that can start and stop a PHP builtin web server to test the app on localhost. This is what I've got on winlaunch.bat so far: php.exe -S ...
0
votes
1answer
36 views

restore bat file default, change its edit

I have windows 7 64-bit, I've been trying to figure out how to set up a bat file to run with admin privilege so my wife can back up her computer by just clicking on it. It's been a journey. I'm a ...
0
votes
1answer
21 views

reg add saves incorrect value for file association

Run from Admin this code works in Windows XP. set app=ExtrNS.exe set nam=ExtrNS@ REG ADD "HKLM\SOFTWARE\Classes\Directory\shell\%nam%\command" /v "" /t REG_SZ /d """"%CD%\ExtrNS.exe""" """%%1"" /f ...
1
vote
3answers
33 views

Start a Command Prompt and then change the title of it via batch file?

I'm trying to start a command prompt via a batch file, echo some text, and change the title of the command prompt. I'm trying: start cmd /k echo This is a terminal /k title Terminal The echo text ...
0
votes
1answer
57 views

Batch to reassign drive letter based on volume name

I have a "WINPE" volume and I am trying to get a batch script that will assign it drive letter "Z:" Someone gave me the script below but it does not work for /f %%D in ('wmic volume get ...
2
votes
1answer
26 views

Copy the most recent of two files with Windows command line

I have a Windows directory which contains 4 files in total. The file names are as follows: Address_1502.csv Address_1602.csv Site_1502.csv Site_1602.csv The prefix of the file name never changes ...
1
vote
1answer
24 views

How to make a batch file that takes in arguments and executes findstr using user input and shows results

This is intended to make a search easier on an individual, and the command line makes people give up. How could I go about having user input be passed through findstr by just using batch files?
0
votes
1answer
77 views

Check whether FTP upload is successful or not using batch?

I am running below code in my ftpUpload.bat. If file is not uploaded to FTP server it should print "FTP upload is failed" but I am getting "FTP upload is successful" for both cases. What change I need ...
1
vote
1answer
47 views

Maximum setlocal recursion level reached. Can't print more then 30 times?

I want to print a defined number of passwords to a file. The code I found on this site is made for 30 loops as I see and I want to print much more, say, 1000. After a few runs, I get this, error? ...