Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

0
votes
1answer
66 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
vote
1answer
102 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
383 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
561 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
93 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 ...
1
vote
2answers
66 views

Batch file to create a folder in every removable device

i Need a batch file to create a folder "test" in every removable device than i plug in my computer (pendrives and etc) i am trying something like this set "extDrive=" for /f %%D in ('wmic volume get ...
0
votes
1answer
162 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
38 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
513 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
51 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
44 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
17 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
539 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
786 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
154 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
2answers
2k 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
81 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
140 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
144 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
641 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
99 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
36 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
77 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
223 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
40 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
50 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
595 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
314 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? ...
0
votes
1answer
29 views

What does “-install” do in the command prompt?

At my job, the procedure to transform a .bat file into a windows service is described as: -Start the command prompt as an Administrator -Type the following command ActiveTask.bat -install I have ...
1
vote
0answers
948 views

Can't execute remote command using PuTTY/ Plink over SSH

Currently I am trying to run bat files call_putty.bat and call_plink.bat, but it isn't excuting the input commands in -m E:\CREATE_ONT.txt When I remove -m E:\CREATE_ONT.txt, the SSH session is ...
1
vote
1answer
640 views

How do I select a random file in a folder?

I am trying to select a random file of a specific type like *.mp4 from a folder (and optionally subfolders) using the Windows command line batch script (no PowerShell) The file full path should be ...
0
votes
1answer
34 views

Add addtional test for files

What would I need to add, to also ignore file names containing AppData with .exe extensions? I am using this in an SetupComplete.cmd for unattended Windows setup, and have AppDataLocal.exe and ...
-1
votes
1answer
63 views

Batch file IF EXIST, all loops getting executed

I am executing a batch file which checks if Java\jre6 present then one type of command will be executed , then at last an else statement, but I find all stmts getting executed together. echo. echo. ...
0
votes
2answers
54 views

How to read each field of an line via batch file

I have a file which contents is as follows Testing:TEST1 --- Import --- Build Testing:TEST2 --- Import --- Build Testing:TEST3 --- Import --- Build Summary: Tests: 3 Failures:1 I needs to ...
1
vote
1answer
499 views

Creating Multiple Subfolders

I have a batch file to create multiple folders, but I need to create 4 subfolders in each of the folders created by the batch file. Can this be done in the same batch file?
1
vote
1answer
104 views

Batch file to change system date on start up?

Cmos battery dead with wrong time/date cant fix it at the moment In the time being I want a batch file to change the system date and time to current as a start up task But if the date/time is wrong ...
0
votes
1answer
284 views

How to set a folder name into a variable to use it in the same Batch file?

i want to make a batch file, This Batch file must look out, into a folder with the name "Draft" and for every sub-folder will be make a search for a .txt file "list.txt" and when finds this .txt file, ...
0
votes
2answers
71 views

How to insert a newline for every occurrence of the word abstract_ using BATCH

I have an xml I need to edit using batch. How do you insert a newline for every occurrence of the word abstract_ in the whole file? Here's a line in the xml (9999999x.xml) <related-object ...
-1
votes
3answers
38 views

Windows 8.1 Batch File Default App

I am making a batch file Contains this @ECHO OFF adb install %1 pause exit I want to make this batch File Default App for .apk files.Is Windows Send Parameters When You Open a file?If not Please ...
0
votes
1answer
868 views

InnoSetup : execute command/batch file after install process is complete

Friends, I'm writing a script which does a lot of stuff - install my application + other opensource software, set up s/w as service, execute batch files to do some stuff etc. 1) I set some ...
0
votes
0answers
27 views

Renaming numbered files with gaps into continuous numbering

I have a group of numbered pictures (for example: "img_938" through "img_1136"). The problem is that there are occasional missing numbers. (e.g "img_972", "img_973","img_975") where my camera ...
0
votes
1answer
152 views

Can a .bat file be used to edit group policy?

I'm setting up a wsus for a local college, and I'm looking into ways that are more effect for updating the Group policy on the computers so that they update via the wsus. Is there a way I can make a ...
0
votes
1answer
272 views

Is it possible to make a VBScript which executes a batch script within itself?

I know it sounds strange, but my idea is creating a single text file which contains a VBScript and a Batch Script within it, i.e. if I run that script as a VBScript, it calls itself as a Batch script, ...
1
vote
3answers
111 views

Get Random Folder name and write it as %FolderName% [closed]

I have: "C:\DIR\FOLDER-NAME_Random-String" and need a script that will check this random name of folder and write it as %FolderName%. I have many computers with C:\DIR\Folder-Name_Random-String ...
0
votes
1answer
116 views

How to organize files by extension using a batch file

I have many types of files spread around various directories on my laptop. I would like to move the files to appropriate directories based on their filename extensions. For example, all image files ...
0
votes
0answers
375 views

I can't get Windows 8.1 to execute batch files through the interface

(moved from stackoverflow where I mistakenly placed it in the wrong spot) Windows 8 has decided that a .bat file has no association. I can't choose to associate it with cmd.exe from the open file ...
0
votes
1answer
21 views

Extracting Lines below Specified Words in batch script and change the format

I have a "test.txt" file in the format of: xdfdfdf ydffddf zddfdfd blah ... WordA 12 23 45 ... 32 12 65 xdfdfdf ydffddf zddfdfd blah ... WordA 54 76 67 ... 68 31 85 xdfdfdf ydffddf zddfdfd blah ... ...
1
vote
1answer
583 views

How to git clone with credentials using batch script?

I have a branch in git repository, I need to clone it from batch file ,can anyone please help?
1
vote
2answers
50 views

Dos script works fine on one machine and not on others, why?

Being not so good in dos-script but have good use for it, I did find here many easy solutions for issues I encounter. So recently I copied a script form here to count the number of files in ...
1
vote
2answers
245 views

Running a Python script from the “Run” prompt

I thought this would be easy, but I've been struggling for a while. I have a Python script on my Windows machine called "myscript.py". I have it in a folder that's on my PATH, and I've added the ...