Search found 82 matches

by PAB
27 May 2020 03:14
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

Re: Extract data to .txt file and then sort new file.

Thank you to everyone who contributed to my request, it is VERY much appreciated!
by PAB
24 May 2020 17:22
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

Re: Extract data to .txt file and then sort new file.

What I would finally like to do is to search a .txt file for the following sentences and have the rows that they appear in output to a file. The code below works great when finding "The drivers for this device are not installed". . . . @echo off Set "msinfo="C:\Program Files\Common Files\Microsoft S...
by PAB
24 May 2020 17:02
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

Re: Extract data to .txt file and then sort new file.

pieh-ejdsch wrote:
24 May 2020 09:28
use this

Code: Select all

find " 0 "
Thanks Phil, that does exactly what I was after!
by PAB
24 May 2020 08:34
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

Re: Extract data to .txt file and then sort new file.

Hello Hackoo , I hope you and your family are OK and keeping safe! That code was great thank you. I have used it [ with adjustments etc ] to sort out all but 2 of my files. If you could just have a look over the 2 below and point me in the right direction please I would be grateful! FILE 1: This is ...
by PAB
23 May 2020 18:04
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

Re: Extract data to .txt file and then sort new file.

Did you mean something like that :?: driverquery /SI | find /I "FALSE" | Sort Thank you for that, I really appreciate it, it is so close! I actually want to KEEP the FIRST 3 ROWS [ the titles ] output from driverquery /si , and then have from LINE 4 onwards to SORT alphabetically on the rows with F...
by PAB
23 May 2020 12:47
Forum: DOS Batch Forum
Topic: [SOLVED] Extract data to .txt file and then sort new file.
Replies: 10
Views: 285

[SOLVED] Extract data to .txt file and then sort new file.

Good evening, This script extracts the data to "%userprofile%\Desktop\test.txt" exactly as required. I am having problems though with copy the first 3 rows from the file above and then extracting all the rows with the word FALSE in it and then sorting the file on row 4 downwards. @echo off if exist ...
by PAB
22 May 2020 09:25
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 377

Re: Incorporate CALL into the script.

ShadowThief wrote:
14 May 2020 23:17
Exactly
Thank you!
by PAB
18 May 2020 08:59
Forum: DOS Batch Forum
Topic: [SOLVED] Extract rows with today's date.
Replies: 4
Views: 254

Re: Extract rows with today's date.

Yes, the second date was in the CORRECT format => echo %y%-%m%-%d% . I did try to use it but I couldn't get it to output any data in the newly created file! >"%UserProfile%\Desktop\Report_DISM.txt" FindSTR "%%y%%-%%m%%-%%d%%" "%UserProfile%\Desktop\dism.log" >"%UserProfile%\Desktop\Report_DISM.txt" ...
by PAB
18 May 2020 07:58
Forum: DOS Batch Forum
Topic: [SOLVED] Extract rows with today's date.
Replies: 4
Views: 254

Re: Extract rows with today's date.

Thanks for the reply and explanation Steffen, it is appreciated! The local settings are in the date format DD-MM-YYYY , and the file output [ dism.log ] is in the date format YYYY-MM-DD . As EVERY line of the file output [ dism.log ] starts with the date in YYYY-MM-DD format, is there any way to ext...
by PAB
18 May 2020 07:28
Forum: DOS Batch Forum
Topic: Changing settings with .bat
Replies: 4
Views: 1402

Re: Changing settings with .bat

Hello @talberto,

I assume you are talking about Win 10?

Have a look here => How to Turn On or Off Night Light in Windows 10

I hope this helps!
by PAB
18 May 2020 06:03
Forum: DOS Batch Forum
Topic: [SOLVED] Extract rows with today's date.
Replies: 4
Views: 254

[SOLVED] Extract rows with today's date.

Good afternoon, I have a long text file that I want to extract ALL the lines with Today's Date. I have tried several ways. This is one of the attempts . . . @echo off >"%UserProfile%\Desktop\Report_DISM.txt" FindSTR "%date%" "%UserProfile%\Desktop\dism.log" Pause I have tried %Date%, %Today%, etc. T...
by PAB
14 May 2020 23:14
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 377

Re: Incorporate CALL into the script.

From an aesthetic perspective, you should indent the code inside of the for loop, but nothing bad will happen if you don't. Beyond that, I expect your code to work as you intend. Do you mean something like this . . . @echo off For /f "Tokens=*" %%i In ('wevtutil.exe el') Do ( echo "%%i" wevtutil.ex...
by PAB
14 May 2020 07:30
Forum: DOS Batch Forum
Topic: Code cmd (input)
Replies: 2
Views: 812

Re: Code cmd (input)

Hello CmdUser202, try this . . .

Code: Select all

@echo off
set /P scelta="Vuoi anche cancellare temp del tuo utente?"
if /I '%scelta%' == 'yes' (
echo fregato!
) else (
echo ciao!)
pause
I hope this helps!
by PAB
14 May 2020 06:25
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 377

Re: Incorporate CALL into the script.

OK, I think I have got it . . .

Code: Select all

@echo off
For /f "Tokens=*" %%i In ('wevtutil.exe el') Do (
rem echo wevtutil.exe cl "%%i"
echo "%%i"
wevtutil.exe cl "%%i"
wevtutil.exe cl System
)
Pause
Can you see anything wrong please?

Thanks in advance.
by PAB
14 May 2020 05:44
Forum: DOS Batch Forum
Topic: [SOLVED] Incorporate CALL into the script.
Replies: 9
Views: 377

Re: Incorporate CALL into the script.

This is some of what I have tried . . . @echo off for /f %%a in ('wevtutil.exe el') do wevtutil.exe el cl "%%a" Pause @echo off For /f %%a In ('wevtutil.exe el') Do ( wevtutil.exe echo %1 "%%a" wevtutil.exe cl %1 "%%a" wevtutil.exe cl System "%%a" ) Pause @echo off For /f %%a In ('wevtutil.exe el') ...