Showing posts with label dos. Show all posts
Showing posts with label dos. Show all posts

Wednesday, December 11, 2019

Command line loops every line in file (DOS & SHELL)



DOS

for /f %i in (filename.txt) do echo %i


SHELL

while IFS= read -r line; do echo $line; done < filename.txt


Tuesday, April 10, 2018

Uninstall application in DOS

# Find any application with "Nero" or "micro" strings then get their version name and version redirect to a file named result.txt
wmic /OUTPUT:C:\result.txt product where( name like '%Nero%' or name like '%micro%' ) get name,version

# List all the installed application name
wmic product get name

# Find application named "Nero 2018" and unstalling it without prompt
wmic product where name="Nero 2018" call uninstall /nointerative

Wednesday, June 28, 2017

Dos for loop with delay

Command below performing 1000 iterations printing number with 1 second delay interval

for /l %i in (1,1,1000) do timeout /t 1 > nul| echo %i

Additional refer:
https://hubpages.com/technology/How-to-Make-A-Windows-Batch-File-Loop-Sleep-or-Delay-For-Specific-Interval-of-Time