All Questions
29
questions
5
votes
2
answers
46k
views
How to input automatically in BATch file on DOS?
I want to run a command that prompt for an argument, can I do a BATch file that run this command and then wait for a sec and "write" or "type" automatically (like a live person) the argument? Thanks.
5
votes
2
answers
10k
views
taskkill - end tasks with window titles ending with a specific string
I need to write a batch program to end all MS office communicator tasks with window titles (usually ending with pattern "- Conversation" .
I tried
taskkill /FI "WINDOWTITLE eq *Conversation" /IM ...
3
votes
2
answers
1k
views
batch file put if inside for loop error
I have a working for loop to print all zip file's name under one working directory:
@echo off
setlocal
for %%i in (*.zip) do (
echo %%i
)
I have another working if block to check and print ...
3
votes
6
answers
28k
views
How to list all files on all hard drives with output in MS-DOS batch?
How can I list all files (including system and hidden) on all hard drives (not removable drives)?
I think in something like a:
dir -a -h *.* /s > file.txt
but this is for the specific drive ...
3
votes
3
answers
2k
views
Substring a variable with two percent in a .bat file
I faced a problem trying to implement a .bat file and I didn't find an answer.
I try to display all folder names without the system path.
I've tried something like that but it doesn't work.
@echo ...
2
votes
1
answer
4k
views
Log date and time accurately with batch file
I have a batch file that backups my files and works nicely, however I wanted to be able to log the exact time each task starts, but it is not working as I expected.
@echo off
> C:\log\%date:~3,2%-%...
2
votes
2
answers
9k
views
Use Batch findstr for files with whitespaces
I'm trying to search for a string in a given file. This file can have whitespaces in its name and I'm having trouble with the Batch file.
I can easily do this by console getting the correct results:
...
1
vote
3
answers
199
views
Variable Assignment for arguments with a for loop [closed]
Alright, so, I've searched quite a bit on how to do this but I've given up as I simply couldn't find anything.
So, I have a code (below); it's main purpose is to get 9 arguments and assign them as a ...
1
vote
2
answers
2k
views
Why is change directory not working when SETLOCAL ENABLEDELAYEDEXPANSION is used
I have an existing windows batch script (named as test1.bat) as below :
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set nop=4
for /l %%z in (1, 1, %nop%) do (
set x=%%z
echo !x!
)
chdir /d D:\app\
...
1
vote
2
answers
2k
views
Running file from batch file
I am working in Windows 10.
This is my code saved in .bat file:
%windir%\System32\cmd.exe "/K" C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\Alex\AppData\Local\...
1
vote
2
answers
4k
views
Run SOX batch on files in a relative folder
I have a windows batch script that runs a SOX command on various files, but I don't know how to get the batch to run on files in a relative path to that of the SOX executable. Currently all the files ...
1
vote
1
answer
557
views
DOS batch file to display netsh channel output
I'm trying to get wifi Channel output from netsh command to be 2.4GHz or 5GHz
The following provides me with Channel output:
netsh wlan show interface name=Wi-Fi | findstr "Channel"
Output ...
1
vote
1
answer
175
views
How to discover the page code to show a specific character in MSDOS/Batch?
I made a batch-file snake game and inserted some special characters via HEX to ANSI conversion in Notepad++.
It worked normally. But I noticed that there was an update to the Consolas font and two of ...
1
vote
1
answer
766
views
How do I download the RSS Feed XML file in dos command batch mode?
I have a specific requirement that I need to download the RSS feed file (it is in XML format) from the given link using dos command.
I have tried the following command and it keeps giving me syntax ...
1
vote
2
answers
1k
views
How to read files name last character and and rename them by running a batch file
I have 3 files in a folder which are:
XXX_a.txt
XXX_b.txt
XXX_c.txt
The filename can be varied, only the last character of the 3 files
a, b and c are not changed
I need to rename the files as below:
...