Text file containing a sequence of commands or program invocations that does not need user intervention.

learn more… | top users | synonyms (1)

1
vote
1answer
1k views

Wildcard Services restart

Currently, we have setup a .BAT file which lists all services to start / stop them eg. SC start SERVICE SC start SERVICE SC stop SERVICE SC stop SERVICE We add new services all the time and the ...
1
vote
3answers
2k views

How to get the Visual Studio installation path in a batch file

Normally, the path is something like C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\. From Visual Studio, one can use $(VCInstallDir)$ to get this path. Q: But in a batch file, how to get ...
1
vote
1answer
4k views

Better-quality FFMPEG conversion from MTS to AVI

I got the following code from some forum. I'm a beiginner, so please bear with my questions ... I need to convert a video from MTS to AVI in very good quality. Currently I'm using the following code ...
1
vote
3answers
334 views

Dump HTML from script

Is there a way to create a script to download the HTML source to a text for html file locally? For example, if I wanted to archive the HTML of Google.com each day. I'm up for batch, VBS or PS1 but ...
1
vote
1answer
758 views

Restarting server with bat file

I'm trying to make a simple bat file that restarts a server. It looks like this: shutdown -r -f -t 60 But all it does is loop inside the cmd window, printing the command > new line > priting the ...
1
vote
2answers
27k views

Batch file to write ping results to a text file

I know this is a variation of an already asked question but after research and several failed attempts I think I need some help. I would like to ping two websites repeatedly and record the time and ...
1
vote
5answers
21k views

Script to shutdown Windows 7 PC

I created a batch file to shutdown my PC (Windows 7 Professional). The batch file is simple, it contains only 1 line: shutdown -s -t 5 But, sometimes, it does not work. I use it by using ...
1
vote
3answers
389 views

bat file for backup system

I created a sample bat file in order to have a back-up system. this does not show what my intention is but it demonstrates it. here is my bat file content; xcopy C:\apps\source c:\apps\dest /D /E /C ...
1
vote
2answers
2k views

How do I check if a program's instance is running or not, before running that program?

I am looking for a software (could be as a BAT script) that could check if a program's instance is running or not, before running that program. And if the software / script detects that the program is ...
1
vote
1answer
56 views

How to write into a Log file from the batch file?

I have a batch file that triggers process in Access database. I'd like to write into a log file (just some *.txt file saved in the same folder) time when before the process started and after it was ...
1
vote
2answers
68 views

Given a list of filenames, how can you iterate through subdirectories and return a list of where those files exist?

I have discovered an old playlist that I'd really like to listen to. Unfortunately, it's one that was created for a USB stick that had music copied out of my collection into a flat folder. What I ...
1
vote
1answer
527 views

Changing virtual memory using batch

I am making a program using batch to boost pc performance and I have now come to the stage where I need to edit windows virtual memory to a size that I can change in the code. if needed it can be done ...
1
vote
2answers
132 views

Detect a change in the number of files or folders

The following script is supposed to check if the number of files and folders has changed since the last time the batch-file was run. If so, it prints a message and updates the counts. Unfortunately ...
1
vote
2answers
328 views

Filling up the hard drive until certain amount of space is left?

I'm doing some testing of a product on Apple and Android devices. I'd like a script that will fill up the devices hard drive until 100KB space is left on the drive it's runs against to. Also in linux ...
1
vote
2answers
2k views

Delete all files older than 365 days, but exclude certain folders

Edit: After @Mbu answer I realized that my first approach with leading numbers in folders as criteria to exclude isn't the right way. I decided to use a fixed list of folders to exclude. I want to ...
1
vote
2answers
48 views

How can I copy identically-named files out of a series of folders, and append the folder name to the filename to disambiguate?

My source folder contains directories containing files like this (each file has the same name): dir1\f dir2\f dir3\f ... I would like to copy all files named f to another directory, renamed as ...
1
vote
2answers
3k views

Leave cmd windows open (called from batch script)

I am launching 4 executables from a batch script: @echo off start ../../../../LD_Server.exe 12321 23432 11221 3 start LD_Client.exe 12321 pero start LD_Client.exe 23432 tina start LD_Client.exe 11221 ...
1
vote
1answer
1k views

How to determine the current directory in a batch file

How can I determine the current directory in a batch file. Other than %~dp0. So that when I run the batch file from source folder (consisting of my files) it returns the path of source folder, where ...
1
vote
1answer
273 views

If I wanted to use a batch file to restart 3 programs how would I do that?

I want to create a batch file that when ran it will exit 3 separate applications, wait a few seconds and then relaunch the same applications. Can someone assist me with some resources for ...
1
vote
1answer
12k views

Add registry key via batchfile

I'm trying to create a registry key with a batch file. I really need to be able to do this via a batch rather than a VBscript or .reg file. So far by using this guide, I've come up with this. but ...
1
vote
1answer
904 views

Run windows batch file from ssh login - env vars missing

I am trying to run a windows batch file from a ssh login. I have successfully installed cygwin w/ OpenSSH on the server (windows 2003). I can log in and run the file, but the file does not run ...
1
vote
1answer
1k views

Why doesn't the bitsadmin.exe download manager work for me?

Why does this bitsadmin command fail? bitsadmin.exe /transfer myDownloadJob /download /priority normal http://mirror.anl.gov/pub/ubuntu-iso/DVDs/ubuntu/8.04/release/FOOTER.html c:\Temp It seems ...
1
vote
8answers
7k views

How do I rename a bunch of files in the Command Prompt?

I have a problem with filenames. The stupid camera I am using resets the autonumber sequence every so often, and therefore I am getting tons of conflicts if I try and put lots of photos in a single ...
1
vote
1answer
515 views

Run a .bat file without typing the extension

I have a .bat file called whois.bat. It accepts one argument which is a userid. From the 'Run' dialog box, I want to be able to type 'whois 99999' instead of 'whois.bat 99999'. The file is located ...
1
vote
1answer
969 views

using “at” command in command line to create repeatable tasks

i did get answer about this question, about 2 years ago: Running bat file using Windows scheduler but now i want to use the same command to create a task that will run every half an hour. how can it ...
1
vote
3answers
12k views

How to automatically make my PC sleep and wake up?

I have a laptop back home with Windows Vista installed. I want my computer to fall asleep automatically at 01:30 AM and wake up at 06:30 AM. I have tried a lot, but making a .bat file which makes it ...
1
vote
1answer
168 views

CMD Command to create folder for each file and move file into folder

I need a command that can be run from the command line to create a folder for each file (based on the file-name) in a directory and then move the file into the newly created folders. Example : ...
1
vote
1answer
601 views

Launch multiple programs in background on windows 8.1

I want to start (launch) three programs in windows and all of them in Background i.e. No windows. I found two ways (both using vb script to hide a bat) Set WshShell = ...
1
vote
6answers
126 views

Batch Renaming Automation *_2.* TO *.*

i am in the process of renaming multiple files from *_2.* to . I want to remove the "_2" suffix My first workaround is trying ren *_2.* *.* but this does not work. Help is apperciated.
1
vote
2answers
512 views

How do I make a batch file the default application for a file type

I am trying to associate .svg files with a batch file that runs squiggle from batik. When I right click on an svg and select Open With and Choose Default Program, I get the usual window, which lists ...
1
vote
2answers
1k views

How to schedule taskkill in bat file

I want something like this:- taskkill 7z.exe after 50sec. code 1 code 2 code 3 7z.exe will be killed after 50 sec but the program should execute code 1 code 2 code 3 without waiting for the ...
1
vote
2answers
2k views

What causes SVN “Working copy <path> is locked”?

I wrote a console application that uses SharpSVN to update 3 folders in my repository. Wanted to convert that to a batch script to removed the dependency on SharpSVN. Came up with this: CD ...
1
vote
2answers
562 views

how to access variables that are set in a different windows batch file?

i have a windows batch file - called fileA.bat, which contains a variable set in it. Sample code of fileA.bat: set fileA_username=michael now i have another batch file, called fileB.bat, which ...
1
vote
1answer
387 views

Detecting computer name

How can I detect if I am on a certain host computer in a batch script? Ex if I run the command hostname it gives me the current computers hostname. Is there a way that I can save that to a variable or ...
1
vote
2answers
874 views

Batch script to remove # from a file name (only in a specific directory)

I'm looking for a script to remove the # character out of any file names in a specific directory (PDF documents). I've been looking at some similar examples, but it's all a bit confusing!
1
vote
1answer
502 views

For Windows systems, will “.bat” or “.cmd” extension make any difference for my script?

Assuming that my shell script is entirely based on DOS commands(dir, cd, etc and not VBS or PowerShell commands), using .cmd or .bat extension for it's name will change something? I mean, it will be ...
1
vote
2answers
442 views

Creating a drag and drop batch file to split an MP3 using ffmpeg

I've got a folder full of FFMPEG batch files that I've written to do various conversion tasks. These allow me to drag and drop a bunch of files and do a conversion - for example, decompressing MP3 to ...
1
vote
1answer
719 views

Unattended installation of multiple programs through batch file

I can install the software by setting auto=1 in install.inf and then use the following script: @echo off for /F "tokens=2 delims=<>" %%i in ('type test.xml ^|find "<install>"') do ( set ...
1
vote
1answer
417 views

Install TortoiseSVN with a batch file

I am looking for a way to install TortoiseSVN via a batch file in order to automate the process of setting it up on several Windows machines. Is it possible to do that maybe with the official ...
1
vote
1answer
249 views

Write a dummy file into every subdirectory?

I want to copy a dummy text file into every subdirectory of a given directory on a network drive (Windows). Because we're looking at hundreds or thousands of subdirectories, I can't do this manually, ...
1
vote
1answer
300 views

How to specify the target directory for LibreOffice 4.0.2.2 .msi file?

How can I specify the target directory for the LibreOffice 4.0.2.2 .msi installation? The .msi file is here: ...
1
vote
1answer
645 views

What are the command extensions for CMD's COLOR command?

The help for CMD.exe lists the COLOR command as being affected by the ENABLEEXTENSIONS arguments. It further states to see what those extensions are you need to look at the command's local help. ...
1
vote
1answer
1k views

How to make a batch file to search all drives?

How can I get this batch file to read all physical and mapped drives? It works fine with C: but will not read any other drive. @echo off set filePath= for /R c:\ /d %%a in (*) do if exist ...
1
vote
1answer
893 views

How to Automate .inf PnP Windows 7 Drivers with Wildcard?

I am trying to automate the PnP driver installs for Windows 7 with either of the below batch files via For loop and wildcard for the .inf file. The rundll32 batch reads and echos the correct .inf ...
1
vote
2answers
216 views

Calling .bat from bash terminates loop

I'm having a problem that is extremely odd to me. I have a loop that reads a file line by line that looks something like this: while read line; do echo "Beginning of loop" ## Call to function ...
1
vote
1answer
2k views

How to run a .bat file as administrator automatically each time when I start a specific program?

In order to speed up my computer start time I disable the VM services in startup; and those services are mandatory for me to start the VMware Workstation when I need to use it. So I wrote a simple ...
1
vote
2answers
368 views

Ubuntu terminal characters required in Makefiles

So the Linux From Scratch Hint recommends that before you even attempt LFS you should be able to build and install emacs from scratch. I am trying to do this. The INSTALL doc claims it's fairly ...
1
vote
1answer
1k views

Run a login script without startup folder

So I have to run a login script when User X logs on. I put that script (.bat) in the startup folder and it works fine. However, I also have to disable the explorer shell and once I do that the startup ...
1
vote
1answer
3k views

How can I loop through all sub folder of FolderA and execute o.bat in each when I execute a.bat?

How can I loop through all sub folders of FolderA and execute o.bat in each when I execute a.bat? /FolderA/a.bat /FolderA/FolderB/o.bat /FolderA/FolderC/o.bat /FolderA/FolderD/o.bat
1
vote
4answers
10k views

What is 7-Zip’s command-line argument to create a self extracting archive?

I looked everywhere and couldn't find a straight answer from anyone. If I want to package the contents of C:\Temp into a file called Temp.exe (in 7z format) that is self-extracting, how do I do it ...