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

learn more… | top users | synonyms (1)

2
votes
2answers
257 views

Automate Windows scanning feature

I have a rather older Canon scanner Pixma MP 110. Of course, Canon does not provide any useful drivers (their site is really desperate, frustrating and useless in all means) - the only software I ...
2
votes
2answers
319 views

Ansicon vs. Batch File

I am attempting to make a colored command prompt in Windows 7. Using ansicon, I have successfully managed to create the prompt. However, when I put the commands into a batch file, I receive an ...
2
votes
0answers
45 views

Printing pages to different feeds (pdf) WINDOWS

We are currently sending out letters that print: Letter on letter-head (customized for recipient) Instructions on regular paper (customized for recipient) These letters are all sent automatically ...
2
votes
0answers
1k views

Batch file to move/compress/delete files

I am trying to write a batch script that will run automatically daily to do the following: Move files older than 2 days to from the main directory (Jason) to an archive directory. Zip files in the ...
2
votes
3answers
3k views

How to set to a variable, the result of a expression

I need to extract the date of a file, for then use this string as part of the name of a new file. I trying to solve this using the next commands: First I get the details of the file and redirect the ...
2
votes
1answer
428 views

.Bat File to Change Wifi Connection to Public Connection [closed]

I need to create a .bat file that will set a wireless connection, eg MyNetworkName, to a public network, so it won't be on Home or Work. I have searched and I don't know how to do this.
2
votes
0answers
709 views

Command line switching

I have read through some suggestions but I am just not technical enough to get this I think. I am a CAD designer and each file has 5 files associated with it. I have 3 sets of 5 files, and each set ...
2
votes
2answers
3k views

How can I set a time-limit on a batch file?

I have a batch file that calls an external program that periodically hangs. What I would like to do is set a time limit on the batch file / CMD prompt such that it automatically closes after a ...
2
votes
1answer
105 views

Is there any way to send messages from the command line in Vista?

I was doing some tutorials on batch scripting when I came across a command prompt messenger tutorial that explained how to message someone directly from their computer. I followed the tutorial and ...
2
votes
2answers
359 views

on Windows, create shortcuts with specific attributes

I'm looking for a way of programatically ( from a batch file ) creating shortcuts to cmd ( or other command line utilities ). This can be easily achieved using SHORTCUT.EXE ( found in ENVARS.EXE ), ...
2
votes
3answers
696 views

Is there some way to universally address the default Program Files folder in Windows 7/2008 via .BAT file?

I'd like to write a batch file, where some commands target items in the Program Files folder, that is naturally cross-compatible from Windows XP up to Windows 7 x64 and Server 2008 R2. However, the ...
1
vote
1answer
5k views

Batch File, PING, errorlevel and > null what do they do?

This seems like a really easy question (running Windows 7). But I have looked for the answer and couldn't find anything at Microsoft's sites (XP PING & Everything else PING) or from a bunch of ...
1
vote
2answers
286 views

Having problems writing a list of simple commands in a batch file

I am trying to run a few simple batch commands in one batch. For that matter each command is a batch command as follows: rails generate scaffold illness name:string rails generate scaffold ...
1
vote
2answers
670 views

How can I pass gui batch arguments in Windows XP/7?

Is there any straightforward way to call a .bat file and have it prompt me for each of the arguments that will replace the %1 %2 and so forth fields? I can memorize their order just fine and run it ...
1
vote
3answers
707 views

Backing up all pictures from a harddrive

My uncle gave me a harddrive to recover from. The harddrive is perfectly intact and no problems with it. I plugged it in and XP allowed me to go in using My Computer. Now the thing is the data is ...
1
vote
2answers
23k views

Create new directory with batch file (MKDIR not working)?

I tried using at first a combination of xcopy and del, but del kept failing. xcopy creates directory if it doesn't yet exist. The other option is to use MKDIR but it does not work inside a batch ...
1
vote
3answers
8k views

Batch file to delete folder and its contents

I'm trying to write a batch file that would loop through a directory and delete any folder that is called "SAMPLE". Here is my code so far, any help would be greatly appreciated! @echo off title ...
1
vote
3answers
1k views

How can I create a popup in Windows with the results of a command called in a .bat file?

I'm calling an exe in a .bat file that returns quickly and I'd like to popup a message box with the results of the text so I can read it (after the program has ended). My .bat looks like this: ...
1
vote
3answers
233 views

CMD copy command

how can I copy all .png files in my current directory to a folder in my current directory called "src"? I tried this code: copy .*.png /src and it didn't work for me.
1
vote
2answers
112 views

What are the slashes with letters (/b, /m, /e, /p, …) used for?

What are the slashes with letters for – as seen in set /p or for /f etc?
1
vote
2answers
26k views

How to extract part of a string, in Windows batch file?

If I have a variable in a batch (cmd) file that looks like "Abc_123", and I want to end up with a variable that has just "123", is there any built-in way to do this? I'm not terribly picky about the ...
1
vote
2answers
355 views

How can I zero-pad numbers in a Batch FOR loop?

I am writing a batch file to do some operations on remote computers in my building. They are all named with the same prefix, but the number at the end changes (01–65). I tried to follow an online ...
1
vote
1answer
2k views

Batch file equivalent in Linux

I have a few basic commands that I need to run on a Red Hat Linux 5 Virtual Machine with GNOME to start a couple servers. Example cd /home/user/scripts sh runTHISthing.sh pub cd /home/user/logs ...
1
vote
8answers
9k 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
3k views

Displaying and storing Windows Batch file output

I've got a batch file written that runs a program we've developped, passing in a number of parameters. Whilst running the program in debug mode, a large number of debug messages are output, which it ...
1
vote
2answers
86 views

Ampersand in Windows Password

I have a password for a Perforce account which contains an ampersand (&) and when I try to use certain P4 commands, I get the following error: Perforce password (P4PASSWD) invalid or unset. I ...
1
vote
1answer
42 views

How to have a batch call another batch based on its location?

I have made a file I will put up for download. It involves one batch file calling another. Most of the time this is not a problem, but in my case I have no clue where they will download it. So how ...
1
vote
2answers
63 views

.bat file doesn't work with comments at top?

I have a .bat file I made to combine multiple files into a new file and it previously looked like this: copy /b ^ E:\file1.txt+^ E:\file2.txt+^ E:\file3.txt ^ E:\output.txt :: comment That worked ...
1
vote
3answers
2k views

CMD keep running program

This isn't very googleable, and other than writing prog.exe -params several times in a batch file (which would obviously only work as many times as I wrote it) I can't think how to repeatedly do this. ...
1
vote
3answers
8k views

Start programs via command-line, but only if not already running

I came up with the batch file below, and it is working great. However, I would like to know if there is a way to code it so that if a program is already running, it would skip it and launch the next ...
1
vote
1answer
504 views

Open PDF to a certain page?

I need a batch file command to open a pdf with the Acrobat Reader on a certain page. "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" <PageNumber> <DocumentName> Thanks.
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
2answers
228 views

CD command not returning correct results under FOR loop

The CD command returns the current directory, and the %CD% variable returns the same result in an environment variable: c:\Temp\test\test1>cd c:\Temp\test\test1 c:\Temp\test\test1>@echo %cd% ...
1
vote
2answers
3k views

Why use start over call when using batch files?

It appears that I can use either start or call to execute batch files however am unsure why you would use one over the other. What are the benefits?
1
vote
1answer
5k 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
373 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
810 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
34k 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
399 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
79 views

Running a batch file command with arguments

I'm creating a script to do some repetitious OpenSSL work, but cannot seem to get the batch file to execute the commands. Once the file has navigated to the correct directory, I try running: openssl ...
1
vote
2answers
36 views

Is there a more compact way to use the IF loop functioning in a batch file?

The classical way is if "%name%"=="john" goto ok if "%name%"=="eric" goto ok if "%name%"=="mary" goto ok But can this be done in more compact way?
1
vote
2answers
84 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
2answers
843 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
1answer
812 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
147 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
476 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
3k 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
56 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 ...