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

learn more… | top users | synonyms (1)

3
votes
2answers
182 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
398 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
953 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
8k 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
1k 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
1answer
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
829 views

Selectively deleting system scheduled tasks

Windows 7 box has a list of scheduled tasks - > Default Windows tasks + Certain custom tasks that all start with a certain string. Previous code deleted all tasks with the command: schtasks /Delete ...
3
votes
1answer
400 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
307 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
606 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
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
4k 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
34k 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
2k 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
181 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
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
147 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
248 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
298 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
4k 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
517 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
110 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
1k 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
2k 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
52 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
476 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
4answers
16k 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
52 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
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
3answers
2k 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
5k 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
10k 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
372 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
4k 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
7k 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. ...
2
votes
6answers
4k views

Why do I have to import .reg file from RegEdit in Win7 and not from .bat file?

I have a .bat file that makes a call to a .reg file (something like: regedit mytest.reg). I run the .bat file as administrator but I get an error: "Cannot import mytest.reg: Error opening the file. ...
2
votes
1answer
37 views

What persistent information does the devcon hwids output contain?

I have a gaming keyboard (Logitech G15) that uses its own software for additional features. Now I am writing a startup batch script that starts that software if the keyboard is connected. It of course ...
2
votes
2answers
364 views

Batch file to poll a folder for new files

I want to write a batch file which is triggered whenever a new file is added to a particular folder. I can schedule a task using schtasks. But I am looking for a solution based upon interrupt kind ...
2
votes
2answers
388 views

Is it possible to have scripts that trigger whenever an IM is received in Microsoft Lync?

I've just upgraded to Lync 2013, and I'm considering using it instead of Pidgin+SIPE. One of Pidgin's many nice features is Growl integration... and I would miss that. There are no Growl plugins for ...
2
votes
4answers
4k 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 ...
2
votes
1answer
410 views

How can I add a value to the registry via command line without a .REG file?

I have a need to add my external IP address to the Windows registry on a scheduled basis, and I want to do this with a bat/cmd file to automate the process. I was able to use the advice from this ...
2
votes
1answer
249 views

Open multi files with batch file

I have a trouble when I open multi images with Irfanview . It only opens one file, and after I close the window, it opens next one. I want to open three windows instantly. I hope someone help me out. ...