Questions tagged [batch]
Batch processing is the execution of a set of commands or software programs without user intervention. A batch file is a text file containing a sequence of such commands or programs invocations. Please use the tag [batch-file] for that.
3,986
questions
-1
votes
1
answer
3k
views
Batch- file to move all files from one location to another in windows?
what I'm after is a batch file that will move all files from one folder to another, with the view eto schedule this as a task to run twice daily.
I know the whole move command etc but appears to be ...
1
vote
0
answers
645
views
How can I batch convert all of my video files to AAC audio without converting the video?
I've used XMedia Recode to do this and it works great. I set video to "copy", audio to "convert", and it takes 2 minutes for a 2GB file. There's two problems with it for batch work though. It doesn't ...
1
vote
2
answers
832
views
Error calling .vbs from .bat
I am currently trying to call a .vbs file from a batch file and it keeps giving me an error.
This is my batch file:
@ECHO ON
cscript "C:\Users\Alex.Newton\Desktop\VBScripts\First scripts\This is my ...
-2
votes
1
answer
5k
views
"The syntax of the command is incorrect."
I've developed a new feature for my Batch game which gives the user the ability to define the name of their own save file along with the loading system and the new saving system is working properly as ...
0
votes
1
answer
3k
views
How to run batch file command line argument on another server?
I have Encrypt.bat on \\RDWAPPserver which contains code to encrypt the file and upload it to FTP server by using 2 commandline parameters.
Encrypt.bat needs 2 commandline parameters exl: \\...
3
votes
1
answer
973
views
How would I query, then toggle Windows updates off and on via a batch file?
Please take it easy on me if I speak out of place is this is my first post. :-) but I've been looking for a way to query the Windows Update service through a batch file and based on its current state, ...
-3
votes
2
answers
3k
views
Destination and Start in on a batch
On a normal windows shortcut we have the Destination field and the Start in field.
Can I do those on a batch ?
.
Complicators:
Windows is on C:
The application is on E:
The Start in folder is on ...
1
vote
1
answer
7k
views
How to show a comfirmation dialog when a batch file window is closed
When users click the close (X) button of a batch file window, I want it to show a confirmation dialog asking "Are you sure want to close this batch file?" with Yes/No options. How can I do this?
5
votes
2
answers
12k
views
Need command to edit a service's log on to Local System Account
When you right click a service in services.msc and go to properties and Log On, it lets you change it to Local System account, how can I switch to that setting with a batch command, I want to switch ...
1
vote
2
answers
6k
views
I can't run .bat and .cmd files with start command (Windows 7)
I can run .bat and .cmd files typing his names in windows console, but if I run with start "" file.bat I get this error: System can't run specified program.
I have tested with a very simple file test....
3
votes
1
answer
61k
views
How do I upload a file to an FTP server using a batch script?
I have created a batch file called FTP_automation.bat which contains the code below.
SET MyPath=E\PGP\test_pg
ftp
open 142.245.30.165 21
TESTA9MS
test11
binary
put %MyPath%
quit
Pause
When I am ...
0
votes
0
answers
2k
views
Ampersand & special character on a Active Directory Name and CMD commands
I have a group that part of its name contains an ampersand &
I am trying different commands for example dsquery group -name A&I-group but it does not work
I tried escaping it using the ...
2
votes
1
answer
808
views
Batch File XCOPY Invalid number of parameters
I'm trying to create a backup batch file, it's been a number of years since I last did one and I'm having a bit of trouble.
I am creating a folder in one location with the date and time in the folder ...
0
votes
4
answers
11k
views
How do I make a registry entry with command prompt?
How can I make command prompt (batch) add this entry to the registry?
To set the value of the LocalAccountTokenFilterPolicy registry entry
Open the registry key:
HKEY_LOCAL_MACHINE\Software\...
0
votes
2
answers
3k
views
Copy all files from a list of folder locations
I have a list of folder locations from which I would like to copy all the contained files at these locations. The list of folder locations are stored on a seperate line within a text file (.txt). All ...
2
votes
1
answer
2k
views
How to pass parameters in batch file and zip the file using 7z.exe?
I need to create a batch file as per below requirements
1) pass path1 & path2 while running the batch file
exl: testrun.bat E:\ERP\test1.txt E:\ERP\header.txt
2) Need to store these command ...
0
votes
0
answers
956
views
Set Windows 7 to "Performance optimized" under Visual Effects with Batch script
I have this .bat script to start a specific game:
@echo off
if not "%~1"=="p" start /min cmd.exe /c %0 p&exit
start "" "GTAVLauncher.exe"
timeout /t 60 /nobreak >nul
taskkill /f /im ...
0
votes
1
answer
484
views
set telnet to use NTLM with command
To set telnet to use NTLM authentication you type in telnet and press enter then type set NTLM
How can I make it do this with a command. using telnet set ntlm for example does not work.
0
votes
1
answer
526
views
TOUCH a batch file from itself
I'd like a batch file to touch itself to an arbitrary date/time. I've tried...
touch.exe -xamq -t 201010201020 -- batch.cmd
start /b "" cmd.exe /c "touch.exe -xamq -t 201010201020 -- batch.cmd"
......
13
votes
2
answers
22k
views
ffmpeg | batch convert | make same filename
How would I use ffmpeg to create a batch convert file for sample rate conversion, such as:
$ ffmpeg -i *.wav -ar 22050 *.wav
Take note, that i'm only doing a sample rate conversion, but in the end I ...
-1
votes
2
answers
8k
views
Commands not executed with %comspec% /k
I am trying to execute a .bat file with a set of commands which can be executed individually through the command line, but not all together through the script:
%comspec% /k ""C:\Program Files\...
0
votes
3
answers
3k
views
Use batch to make duplicate files based on one extension
How can I make copies of some files with a specific extension (but changing the extension) just based on their extension?
I've tried just showing those files but get nothing:
@echo off
for %%f in (*...
0
votes
1
answer
2k
views
Getting GUID from Mountvol in Batch file
This is sort of silly, but today is the first day I'm using batch scripts, so bear with me.
I'm using the following code to find a particular drive letter assigned to a volume.
set "volume=\Volume{...
0
votes
2
answers
4k
views
How to write to a batch file to tell it to write to another batch file
How to write to a batch file a command which itself writes to another file. Basically what I'm trying to achieve is this
File1.bat
echo abc >> op.txt
File2.bat
echo abc >> op.txt >&...
0
votes
2
answers
14k
views
%%f in a batch file with Windows 7 Professional 64 bit
I have a line like the following in a several batch files:
FOR %%f IN (%*) DO something.exe %%f
I've used them for a long time with no problem. I recently had to replace my hard drive and had ...
1
vote
1
answer
4k
views
IF statement in batch file not working properly
@ECHO OFF
PAUSE
IF EXIST "C:\Program Files\NexphaseV6\ECF" (
ECHO Directory exists!
PAUSE
) ELSE (
MKDIR "C:\Program Files\NexphaseV6\ECF"
ECHO Directory made!
)
PAUSE
When I run ...
0
votes
1
answer
4k
views
Delete all files in the folder except one extension(say .idf) using batch file [duplicate]
My current code to delete all files in a folder older then 2 days is :
forfiles /p "C:\Test" /s /m *.* /c "cmd /c Del /F /Q @path" /d 2
There is one .idf file among all other files. I want to delete ...
2
votes
1
answer
2k
views
WMIC |more has extra rows when .csv opened in Excel
I am trying to output the name and version of each program installed on my system to a .csv file. I could do something more complicated with VBScript, but would prefer to keep this very simple to ...
0
votes
1
answer
802
views
Automatically enable telnet services with batch
Even after installing telnet it will not work until you go services.msc and enable Telnet by changing the setting to automatic. Is there a way I can do this preferably with cmd or otherwise with ...
2
votes
0
answers
77
views
What are the underlying Windows7 mechanics that are responsible for opening selected files via key 'Enter'?
I need to create a batch script that opens n files, of same type and same suffix, with program p,
without creating n instances of p (i. e. use multiple tabs instead of multiple instances).
For some ...
5
votes
5
answers
12k
views
Have the command prompt launch an application like Notepad and block until it is closed
I have a Batch script I essentially want it to present the user with a notepad window opened with a configuration file for the user to edit each time they run the script, and I want the Command Prompt ...
2
votes
3
answers
9k
views
Parse string using batch script
How can I parse string using batch script?
Goal is to save in a array everything under Import: and strip out #head for example --> //MPackages/Project/config/abc.txt and //Packages/Project/config/cde....
0
votes
1
answer
917
views
NET USE remove if no right
I have a .bat for connecting network drives. I have 11 in total.
My script works, but for now even if the user has no rights, that it connect the network drive.
I would like if the user does not have ...
0
votes
1
answer
612
views
Windows: How can I use the command line to set registry permissions
OS: Windows 7
Desirable Method: Command Line
Other acceptable methods: VBScript
How can I use the command line to set registry permissions? I found the REGINI utility, but I'm not having any luck ...
1
vote
2
answers
10k
views
Batch - How to cat multiple files together without header records
I'm attempting to merge multiple files together with the following command:
copy test1.txt+test2.txt test3.txt
This works just fine, however, the files I'm attempting to merge contain header records ...
2
votes
1
answer
2k
views
How to crop images in batch and then re-crop the same way
I am getting automatically generated screenshots of our application, some of which need cropping, since they may only relate to a pop up window or some small portion of the screen.
Is there some way ...
2
votes
3
answers
4k
views
using tr from coreutils for windows
I have to transform contents of file from \ to \\ on Windows in script. So I got Coreutils and tried to use tr \ \\ < file_in > file_out on Windows CMD, but \ in file_out remainde \ instead of ...
3
votes
5
answers
17k
views
How to find process pid of an application
I have portable version of an app. I have ran for example 5 multiple instances of it and they all have the same process name but different pids. I want to find a way to for example kill one specific ...
0
votes
1
answer
787
views
Appending an extension to a new file created with xcopy
I've been having problems with xcopy in the past few days, and I'd like to stop ripping out my hair. In my DOS class, a portion of an assignment requires a file to be copied (with xcopy), and the new ...
4
votes
1
answer
46k
views
Making Batch to run Windows PowerShell, then have it run some text
I am newer to making batch files. I am trying to run a command that will open windows PowerShell in a specific directory, and then once there to run a command.
So far I have the following. Powershell....
1
vote
1
answer
985
views
WIX: Run batch file based on checkbox value with admin right
I created a installer using WIX.
However, after installing the software, I have a checkbox asking the user whether to run a batch file or not. If the user check the checkbox, the batch file will run.
...
2
votes
1
answer
3k
views
Batch command to archive folders with content using WinRaR
I have lot of folders in the root "C:\Test\Archiv\" (more than 1000).
To be more specific, I get one every hour.
They are named as following : ay %year% m %month% d %day% h%hour%
In each folders are ...
0
votes
1
answer
421
views
Is it possible to filter attribute of dos command output?
Below is output of this command netsh interface ipv4 show interface
Idx Met MTU &...
-1
votes
1
answer
6k
views
How to download from a direct link using batch files and Google Chrome? [duplicate]
I want to create a batch file which is capable of downloading any files from direct links.
I already tried this:
chrome start http://dl2.romhustler.net/download/MTOeeo3FWffukwoWvagsXw/1430069124/...
4
votes
1
answer
11k
views
How do I make exclamation marks show using echo
Earlier today, I was continuing on making an RAR Password Decryptor. I was testing it out on a test RAR file with the password being just an exclamation mark but when I use my Decryptor all it says is ...
2
votes
2
answers
2k
views
MRenaming network interfaces based on index with WMIC and netsh with Batch
I have two Intel NIC's that I need to rename based on their index numbers, WMIC is nice in that it seems to always return index numbers in numerical order so we can take the output directly without ...
1
vote
2
answers
11k
views
Batch file FOR command skipping lines
I need some help with the FOR command in batch filing. What I want to do is read the file "Test.txt" and read only the third line and turn it into a usable variable within this batch file. Here is ...
8
votes
2
answers
28k
views
How do I detect the number of parameters to a batch file and loop through them?
Is there an easy way to detect the number of parameters passed as arguments to a batch file, and then use for /L to loop through them?
1
vote
1
answer
1k
views
Batch create PDFs by combining all PDFs in folders [duplicate]
I have hundreds of folders full of PDFs. I would like to create a PDF out of each folder called the name of that folder.
For example, "folder_name_1" has 10 PDFs. I want to convert it to a PDF ...
0
votes
0
answers
90
views
batch script to list local hard drives and then do a dir command on each drive
I tried to make a script following this topic
"batch script to find drive letter of a mounted device"
With help of one stackoverflow user we got the script running.
This is the script:
@echo off
...