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

learn more… | top users | synonyms (1)

4
votes
1answer
969 views

Disable close button on DOS program in Windows 7

At my company we have stores that run some old DOS software. Before Windows 7 you could run these programs in full-screen and now you cannot. I know there are work-arounds to get in full-screen ...
4
votes
2answers
18k views

batch script that grants admin rights and goes through all files and folders

I have this, pretty sure its a little harsh but does the job, gives me all the rights to the files and folders on a drive when run on a drive, now I need help getting it to go into sub directories, so ...
4
votes
1answer
5k views

Get current folder name instead of current path in windows batch file [duplicate]

Possible Duplicate: Get current folder name by a DOS command? In my batch file, I have, SET currentFolder=%CD% echo "%currentFolder%" Prints the whole directory path. C:\www\scritps\ ...
4
votes
4answers
25k views

7-Zip CMD: Add current date to archive and include only the last modified folder in archive

I'm trying to create a backup script with 7-Zip. I have everything else done already, but these two issues are still blocking me. Firstly, I want to add a timestamp with a create date like this: ...
4
votes
2answers
214 views

Replacing certain word in text file using Batch file

I am trying to use a batch file to determine the currently installed drive letter and to replace a keyword in the ini file with the drive letter. Basically the ini file contains: [app] ...
4
votes
1answer
919 views

Batch File To Detect And Set Windows 7 Power Mode

I would like to create a batch file that checks the current system power mode and change it if necessary. I have the following. What am I doing wrong? (it does not work) @ECHO OFF SET ...
4
votes
2answers
1k views

Batch file for creating files according to the days in a month

Update This is not working in my office pc. When i specificy the current month day as only 2. This is an data which it throws:- How many Days this month: 2 The Month is (Blank) The Day is (Blank) ...
4
votes
1answer
100 views

Batch File IF Statement Time Taken

I am trying to write a batch file that takes the time taken of a command and converts it into hours, minutes and seconds. Here's what I've got: @echo off set /a sec=0 set /a min=0 set /a hrs=0 for ...
4
votes
3answers
424 views

Use DOS batch to move all files up 1 directory

I have created a batch file to be executed through the right-click menu in Win7. When I right-click on a folder, I would like the batch file to move all files (excluding folders) up 1 directory. I ...
4
votes
1answer
721 views

How to call a cmd on a remote server without having the absolute path

I would like to call a cmd (let's call it x.cmd) on a remote server. The x.cmd will return a log file in a log folder. Problem is this log folder in x.cmd doesn't have an absolute path (just a ...
3
votes
7answers
11k views

Why does the PING command in my batch file execute in a loop?

I created a .BAT file in Windows 7 that has the following line: PING XXX.XXX.XXX.XXX -t (XXX replaces the actual IP number). However, when I double click on this batch file, I can see the PING ...
3
votes
4answers
7k views

Can I run bat file on 64 bit system?

I have a bat file that I ran successfully on my old Windows Vista 32 bit system. Now that I have upgraded to a 64 bit Windows 7 system, will it be possible to run the same bat file? Is there a ...
3
votes
3answers
8k views

Dump contents of a cmd prompt into a file, from a batch file

So, I have this batch file that runs every morning at 7 AM and does some work in a Windows command prompt. What I need this batch to also do is save the output of the cmd prompt work that was ...
3
votes
2answers
2k views

How can I stop percentage expansion in a batch file?

(This is on NT based Windows like 2000, XP, Vista, 7) On the command-line, the percentage characters are ignored: wget ...
3
votes
1answer
1k views

Fire batch (.bat) file execution and continue

I want to write a .bat file that starts executing another few .bat files, without waiting for the 1st to complete before going to the next one. Spawning multiple cmd.exe commands is OK. I tried doing ...
3
votes
2answers
502 views

How to answer a prompt in a batch file

Per suggestion I added /ad to return only dirs, but continue to get prompted. The prompt suggests it wants to know whether to create a file or directory. How do I automate the answer in a batch ...
3
votes
2answers
7k views

Run a program in a batch script and wait for it to finish before continuing

I have a very specific requirement. I am attempting to upload files via sftp which uses private keys. I already have a bat file that connects to the host and uploads the file however I need to move ...
3
votes
2answers
10k views

Dump batch script output into a text file without specifing batchfile location beforehand

Im aware that i can get the output this way (to capture both standard and errors): [batchFilePath] > [logFilePath] 2>&1 Or this way for standard output: C:\MyBatchFile.bat > ...
3
votes
2answers
2k views

How to run a windows .bat script with wine from command line?

I'm trying to run a batch script from my mac terminal using wine (in order to provide arguments to a windows executable and piping output). so far I've tried executing wine runme.bat but ...
3
votes
1answer
4k views

Connect to VPN using command line results in error 691

I've wrote a simple batch file to connect to a specific VPN connection using RASDIAL rasdial MyVPNConnection but it always returned the error 691 Access denied because username and/or ...
3
votes
1answer
642 views

Batch file infection command explanation

I do know that commands below is used to infect executable files. But I don't know how they work exactly. Can somebody explain this to me? @echo off Dir %Homedrive% /s /b > DirPath For /f %%Y In ...
3
votes
3answers
2k views

Can I get UAC prompt for user from batch file?

Can I get UAC prompt for user from batch file? For example I need put some keys to registry under CurrentControlSet from batch file by reg import path\to\my.reg PS. runas is not a solution as ...
3
votes
2answers
1k views

Automatically accept Windows Logo testing?

I am trying to upgrade a printer driver remotely and have prepared a batch file for this. The only problem is that when I'm installing the drivers I get a popup in which I need to press "Continue ...
3
votes
4answers
12k views

Is it possible to copy a set of files, but automatically skip if file already exists?

I know that the copy command has an option to automatically replace a file if it already exists, but I want to know if it is a way to copy the files only if they not already exist (/Y). I do not know ...
3
votes
1answer
77 views

How to make ConEmu attach on start

I have an existing .bat file which uses the start command to launch multiple tasks, e.g.: start cmd.exe /k "echo task 1" start cmd.exe /k "echo task 2" start cmd.exe /k "echo task 3" What happens ...
3
votes
1answer
1k 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 ...
3
votes
3answers
3k views

reg query; Windows 7 vs Windows XP

I can run the following reg query command in Windows 7 and get the following results: command- Reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s /f "EMC Avamar for Windows" ...
3
votes
2answers
2k views

Find all MKV files and remove all subtitles

I'm currently looking at a Windows program called mkvmerge. I would like to create a batch file to find all MKV files recursively from a specified path, and remove all subtitles from the MKV files ...
3
votes
4answers
7k views

How can I start a batch script before logging in?

I have set up my computer to boot at the same time everyday when I am not home. I need it to run a batch file without anyone touching it right when it boots. I have added a shortcut to the file in ...
3
votes
1answer
575 views

How do i run app in bat nonblocking?

Lets say i want to do gcc a.cpp BUT i dont want to block. I just want to run and continue, like running in the background. How do i do that in a bat file? I'm using windows 7
3
votes
2answers
5k views

How to run the “runas” command without writing the password

I need to run the "runas" command for log on automatically an Application User, on an Active Directory. Then I need run an executable file. Can I do this in some way or work around to do not type the ...
3
votes
2answers
5k views

Simple windows batch file that will copy a file to a folder, and create a sub-folder with timestamp

I have a file at: c:\source\hello.txt That I want to backup as I modify it often, to here: c:\backups\source\????\hello.txt How can I create such a .bat file to do this? I want the script to ...
3
votes
1answer
407 views

Running batch file in notification area

Is there any simple code that will make my batch file process, when run, to go to the notification area rather than the taskbar?
3
votes
1answer
7k views

How to excute commands over SSH in a batch file?

I'm looking to, all in the course of one batch file: ssh into a remote computer execute commands (per the batch file) on the remote host. What options do I need to add to the ssh invocation so ...
3
votes
1answer
508 views

Windows cmd output redirection to standard input ( >&0 )

From a question on Stackoverflow, i've being testing with redirection from/to stdin stream. And this tests, trying to send data to the stdin stream, just to see what happens, end with an apparently ...
3
votes
1answer
1k views

How can I do string translation on the windows command line

If I have something like set value = c:\\some\\path I want to convert this to c:\some\path. How do I do this?
3
votes
2answers
3k views

Programmatically adding entries to Windows 7 Start Menu?

How does one add entries to the Windows 7 start menu for All Users programatically? For example I might want to add the folder MyApps containing a shortcut to myapp.exe and a URL for www.myapp.com. ...
3
votes
1answer
2k views

How can I batch/mass create users for a Filezilla FTP server?

I recently inherited two FTP servers; both systems run Filezilla Server. One has a small user-base so creating users is a small task. The other is huge and needs to have 300+ users created. I estimate ...
3
votes
1answer
195 views

how to automate a batch script

I would like to run a batch script at 5:00pm every day. How to do that? Usually QA people automate their test reports every night for regression and BVT test for example. Has anyone any insight into ...
3
votes
1answer
6k views

Batch File that copies the first 2 lines of a text file into another text file

I have a text file A.txt Pinging [xx.xx.xx.xx] with 32 bytes of data: Request timed out. Ping statistics for xx.xx.xx.xx: Packets: Sent = 1, Received = 0, Lost = 1 (100% loss) I would like to ...
3
votes
4answers
45k views

Batch moving files to another folder/directory in Windows?

I am getting an error message to the effect of unable to move files to a single file. I am not trying to do this. What I am trying to do is move files from one folder to another folder (staging) and ...
3
votes
1answer
39 views

Index files and folders in windows

I want to create a database of all files and folders within a specific location (say, E:\movies). How can I do this? Is there any software which can do this for me? Otherwise do I need to write code ...
3
votes
1answer
481 views

Creating a batch OR .bat file to linearize and merge PDFs using QPDF.exe

I am trying to create a batch OR .bat file that will linearize MULTIPLE PDF files. I already have a script I commandeered that uses PDFTK that sends PDFs to the 'sendto' folder where they are ...
3
votes
2answers
1k views

Why does Robocopy ignore the /copy flags?

Robocopy Copy Flags? I just recently made an answer here http://stackoverflow.com/a/15211788/891976 where I suggested using robocopy and its /copy flags, but for some as of yet unknown reason, the ...
3
votes
1answer
7k views

Batch script to reboot a Windows 7 PC

I want a system restart batch script to: On first execution, it should put this script in startup folder It should re-start the system. So that it keeps on restarting user's system. Can you ...
3
votes
2answers
248 views

Creating a txt file for certain type of files using batch

I have a folder containing all types of files. Let's say my folder path is E:/temp. I would like to create, only for the .avi type files, a txt file and name the txt file as the name of the movie. ...
3
votes
1answer
3k views

How do I disable a wired network interface using Windows batch scripting?

How do I disable a wired network interface using Windows batch scripting? What commands do I need to use?
3
votes
1answer
84 views

Why are some .bat files “run as an administrator” bold in Windows 8?

When I right click on some .bat files the "run as administrator" selection is bold. Why is this? How do I make it so that all .bat files act that way too?
3
votes
1answer
474 views

How do I go about batch-optimizing image files with a script?

I'm using OptiPNG for a large amount of PNGs I need to optimize. I can get it to run with a batch script where the application and image are in one folder together. start.bat contains: start ...
3
votes
2answers
593 views

How to start a de-elevated cmd from admin command prompt

I have an administrator command prompt. I'd like to load another command prompt from here without administrator priveledges. I'm pretty sure its some usage of 'runas' but I can't find the ...