Skip to main content

All Questions

Tagged with
0 votes
0 answers
22 views

“psloglist” for system event returns an error: -1073740940

My batch must extract system and application events. I use two psloglist (vers. 2.82) cmd one after the other. psloglist \\Home -d 7 -f we sys > system.log psloglist \\Home -d 7 -f we app > ...
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
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
1 answer
361 views

Loop n-times on DOS 6.22

FOR /L %%parameter IN (start,step,end) DO command does not work on DOS 6.22. The /L argument to loop through a set of numbers is not available in DOS 6.22. FOR in DOS 6.22 can merely loop through a ...
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 ...
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: ...
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 ...
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\...
0 votes
1 answer
2k views

How to start Notepad++ from a Windows 10 batch file?

When I Google this, I get pages about running Notepad++ from the command line, running batch files from Notepad++, and pages that start by explaining how I set my path variable. I am not allowed to ...
0 votes
1 answer
840 views

How can I check if a file starting with a letter is in the folder?

Why does this script always return "A" even when there are no files starting with A in the folder, but there being files starting with B and C? @ECHO OFF if exist %cd%\a* goto A if exist %cd%\b* ...
0 votes
1 answer
38 views

Writing out to a file based off of the output of the command

I have seen many examples of how to create a file through command line using a static name but I need to get it to show a dynamic name based off of my commands output. What I mean by this is the ...
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%-%...
0 votes
1 answer
261 views

*NIX getopt alike for DOS

I want to write a DOS script with multiple optional option flags. I have to parse these optional options. An example: get_resolution.bat /? get_resolution.bat /h input.jpg get_resoltion.bat /v ...

15 30 50 per page