Search found 57 matches

by PAB
08 Nov 2019 07:32
Forum: DOS Batch Forum
Topic: Get only information from PHYSICALDRIVE0.
Replies: 1
Views: 140

Get only information from PHYSICALDRIVE0.

Good morning, I have spent hours on the following which works fine if a USB or external HDD is NOT attached . . . For /f "Tokens=2 Delims==" %%a In ('wmic DiskDrive Get Caption /Value') Do Set "PC_HDDMakeModel=%%a" For /f "Tokens=2 Delims='='" %%a In ('wmic LogicalDisk Get Description /Value') Do Se...
by PAB
07 Nov 2019 12:52
Forum: DOS Batch Forum
Topic: [SOLVED] Query if battery is installed.
Replies: 2
Views: 144

Re: Query if battery is installed.

Brilliant Steffen, it is appreciated!
by PAB
07 Nov 2019 10:03
Forum: DOS Batch Forum
Topic: [SOLVED] Query if battery is installed.
Replies: 2
Views: 144

[SOLVED] Query if battery is installed.

Good afternoon, I would like to know if a computer is a Desktop or a Laptop . I have tried retrieving the information using Powershell and batch script but I am having trouble interpretting it because some code produced "No Instance(s) Available", some the number "2" etc. I am really close but can't...
by PAB
07 Nov 2019 09:39
Forum: DOS Batch Forum
Topic: [SOLVED] Find BIOS Mode.
Replies: 4
Views: 339

Re: [SOLVED] Find BIOS Mode.

Brilliant, thank you.
by PAB
07 Nov 2019 09:37
Forum: DOS Batch Forum
Topic: [SOLVED] Suppress message so it shows as blank.
Replies: 11
Views: 1335

Re: Suppress message so it shows as blank.

Thanks Steffen, it is appreciated.
by PAB
06 Nov 2019 12:26
Forum: DOS Batch Forum
Topic: [SOLVED] Get TRUE HDD data as opposed to CAPACITY data.
Replies: 5
Views: 250

Re: Get TRUE HDD data as opposed to CAPACITY data.

Thank you. When I put it in a batch file of it's own it works. I have tried to implement your instructions but I can't get it to work, it exits the cmd prompt and doesn't create the output file! Here is some cut down code with your code included . . . @echo off SetLocal EnableDelayedExpansion Set OU...
by PAB
06 Nov 2019 07:03
Forum: DOS Batch Forum
Topic: [SOLVED] Get TRUE HDD data as opposed to CAPACITY data.
Replies: 5
Views: 250

[SOLVED] Get TRUE HDD data as opposed to CAPACITY data.

Good afternoon, After something I was doing yesterday and Steffen managed to sort out for me, I noticed that what I did a few days ago was actually incorrect. It is getting the true size of the HDD as opposed to the capacity. This is the code that works but gives the capacity rather than the true si...
by PAB
06 Nov 2019 03:00
Forum: DOS Batch Forum
Topic: [SOLVED] Delete row in >> %OUTPUT%.
Replies: 8
Views: 307

Re: Delete row in >> %OUTPUT%.

Thanks Steffen, it is appreciated.
by PAB
05 Nov 2019 19:00
Forum: DOS Batch Forum
Topic: [SOLVED] Delete row in >> %OUTPUT%.
Replies: 8
Views: 307

Re: Delete row in >> %OUTPUT%.

FOR /F loops will remove empty lines for you before they get written to the file. >>%OUTPUT% (for /f "delims=" %%i in ('wmic logicaldisk get deviceid^,volumename^,description') do for /f "delims=" %%j in ("%%i") do echo %%j) >>%OUTPUT% echo( >>%OUTPUT% (for /f "delims=" %%i in ('echo list volume^|d...
by PAB
05 Nov 2019 18:41
Forum: DOS Batch Forum
Topic: [SOLVED] Delete row in >> %OUTPUT%.
Replies: 8
Views: 307

Re: Delete row in >> %OUTPUT%.

In the future you should ALWAYS provide a verifiable example of the code you are using to produce the problem. Time is a precious resource for everyone who helps on the forums. Your question could have been answered with one response instead of multiple. I am sorry Squashman , I will keep that in m...
by PAB
05 Nov 2019 17:25
Forum: DOS Batch Forum
Topic: [SOLVED] Delete row in >> %OUTPUT%.
Replies: 8
Views: 307

Re: Delete row in >> %OUTPUT%.

Here is the code . . .

Code: Select all

wmic logicaldisk get deviceid, volumename, description | more >> %OUTPUT%
echo list volume | diskpart >> "%OUTPUT%
Thanks.
by PAB
05 Nov 2019 15:42
Forum: DOS Batch Forum
Topic: [SOLVED] Delete row in >> %OUTPUT%.
Replies: 8
Views: 307

[SOLVED] Delete row in >> %OUTPUT%.

Good evening, I have a batch script that outputs to a file, for example . . . echo Title: %var1% >> %OUTPUT% echo Title: %var2% >> %OUTPUT% echo Title: %var3% >> %OUTPUT% It can leave several blank lines in between even though there are none in the code. Now I am pretty sure the answer is going to b...
by PAB
04 Nov 2019 15:58
Forum: DOS Batch Forum
Topic: [SOLVED] Find BIOS Mode.
Replies: 4
Views: 339

Re: Find BIOS Mode.

That's brilliant Steffen . I can confirm the code works on LEGACY mode. So what would I use if I just needed to know if it was either UEFI or LEGACY please? This produces LEGACY on my computer, does it produce UEFI on yours please? @echo off &setlocal set "securemode=" set "biosmode=" for /f %%i in ...
by PAB
04 Nov 2019 11:37
Forum: DOS Batch Forum
Topic: [SOLVED] Find BIOS Mode.
Replies: 4
Views: 339

[SOLVED] Find BIOS Mode.

I have been trying to find what BIOS mode is being used. For example, I just want it to show either . . . UEFI with secure boot disabled UEFI with secure boot enabled LEGACY boot enabled I have looked at doing this from bcdedit /enum . I have tried reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\S...