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
259 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
8k 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
3answers
6k 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
220 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
1answer
458 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
9k 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
3answers
2k 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
1k 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
2answers
3k views

how can I make my .bat file continue after an error

I have a .bat file in windows that does three things cmd1 arg1 arg2 cmd2 arg3 cmd3 arg4 arg5 arg6 Sometimes cmd1 can fail and that's fine, I would like to carry on and execute cmd2 and cmd3. But ...
3
votes
1answer
456 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
1answer
3k 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
341 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
265 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 ...
3
votes
1answer
789 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
2k 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
5k 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
38k 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
99 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
3answers
2k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
3
votes
1answer
3k 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
196 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
156 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
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
347 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
375 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 ...
3
votes
1answer
6k views

Launch a shortcut using batch file

Here's the problem. I have a shortcut on roughly 260 computers located in the same folder as below; "c:\documents and settings\all users\desktop\Remote agent 1234.lnk" The only thing that changes ...
3
votes
1answer
2k views

Can you send function key commands to DOS from a batch file?

I am new to batch files and I need to write one for a program that runs in DOS. One of the questions on the prompt requires a function key command (i.e. F1, F2, etc). I've read an article that says ...
3
votes
1answer
573 views

Windows Dos/Batch File Books

I recently moved to a new company that uses Windows batch files left, right and center. Is there a definitive book of writing / using batch scripts out there? It's mostly Windows XP and Server 2003 ...
3
votes
1answer
113 views

Batch-file to remove part of a number before passing it to an application

I've been racking my brain trying to get my softphone to dial numbers on web pages. I've gotten the browser to pass the number through to the softphone, but it adds tell:+ to the number and won't call ...
2
votes
5answers
2k views

How can I find out the actual path to an EXE or BAT file?

If I have a long and involved PATH and I type the name of some command, how do I find out where the EXE or BAT file actually lives. I thought TRUENAME did this but it's gone from XP and I'm not sure ...
2
votes
5answers
3k views

How to automatically move a file to another PC on the network?

Here is what I am after. I have 2 PCs connected on a network and one of them prints out an excel spreadsheet every night to a specific folder. is it possible to use a batch script to copy that file ...
2
votes
2answers
63 views

Trying to hide this text that shows up after “pause” in cmd

This text "Press any key to continue", I don't want this to show up, is there a way I could hide this part of the text but I also want the previous to stay, thus the pause command.
2
votes
3answers
2k views

Rename folder according to mp3/flac tag information

I would like all folders in my music collection to be renamed with a date, which is tagged in the music files inside them. Basically, change Dire Straits - Money For Nothing in Dire Straits - 1988 ...
2
votes
1answer
5k views

Batch convert *.avi files using ffmpeg

I am trying to convert 20+ .avi files in a batch using ffmpeg. I've got the following @echo off. for file in *.avi do ffmpeg -i "$file" -s 640x480 -vcodec msmpeg4v2 "'basename "$file" ...
2
votes
2answers
507 views

Unable to see the files hidden by a batch script

If I hide a file using command attrib +s +h file.txt. Then set the option 'view hidden files' in Windows 7, but it is not possible to see file.txt. Why can't I see the files hidden by the batch ...
2
votes
1answer
2k views

takeown /R not applying to hidden files

I'm running a batch command to take ownership of a set of user folders and I'm finding that the ownership is not being pushed down to hidden files, such as ~normal.dot I'm using the following command: ...
2
votes
4answers
17k views

change exe option to run as administrator by bat script on Windows 7

I can't disable UAC in Windows 7 and I want to change .exe option to run as administrator. I can right click on icon and goto compatibility then change this option through GUI but I have to do by ...
2
votes
2answers
56 views

Delete file if found

I have a batch script with a line like this: del "%TARGET_DIR%\packages.config" But if packages.config does not exist in the target directory it produces an error. Could Not Find ...
2
votes
3answers
3k views

How to start executables through command prompt with space named files and without command prompt waiting program to close?

I would like to create shortcuts to some executable files (exe, bat, com...) on Windows 7 using bat files, but I had some troubles with that: start notepad.exeworks perfectly, but start Foxit ...
2
votes
1answer
3k views

Windows 7 batch files: How to write string to text file without carriage return AND trailing space?

I am trying to have my batch file write a string of text to a text file. At first, the command I was using was writing an extra carriage return to the end of the string, but I found this command that ...
2
votes
1answer
6k views

How can I copy a file on a network share using a different login with powershell or batch file?

I have a file in a shared location that I want to copy over to my local harddrive. However I will not be running as a user that has access to the share. So I want to be able to authenticate under a ...
2
votes
3answers
11k views

How to loop through folders and rename extensions in a batch file?

Selecting a single folder I could run ren *.jpeg *.png I have multiple folders. I want to create a batch file that will loop through all the folders and will rename the files within it. For ...
2
votes
1answer
2k views

In Windows-7 run command from batch file with reduced priority

I am starting a long, memory and CPU-intensive run. I know how to change the process priority manually from the task manager. Is there a way that I can run it at low priority from a .bat file, since ...
2
votes
2answers
432 views

In a specified folder, how can I recursively delete everything except “.mkv” and “.nfo” files?

I'm trying to figure out the code for a batch-file (Windows) that In a specified folder recursively deletes everything except files with a certain extension (i.e. .mkv and .nfo)? Something like this, ...
2
votes
1answer
1k 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 ...
2
votes
2answers
5k 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 ...
2
votes
1answer
8k views

How can I read a comma delimited text file in a Windows batch file?

I can get it to read the text file until it becomes a comma delimited text file. I would like to read the two variables on each line and test each one with a If statement for another condition. ...