Creating a script to gather PC information - to assist those asking for help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#121 Post by aGerman » 08 Sep 2016 16:25

Unfortunately I had no time today :( Thanks for taking the time to get a deeper insight into the script!

@Dave
I think if we create a script of a thousand lines of code nobody would ever run it :lol: Douglas already suggested to have some specific scripts up our sleeves. Your suggestions could be part of those scripts. The original intention was to point out the basic differences. Maybe it's already a bit overdone.


@elzooilogico
there's a typo on line 86

What a silly bug :oops:

Codepages may produce weird characters when language special chars are used, here Versi¢n should be Versión.

I'll solve it like I did for the DIR command (using CHCP). Thanks, I wasn't aware of that failure.


@Douglas
I've noticed that all the results posted so far report that delayed expansion is disabled for both the system and the user. That seems unlikely, and I think it's because the test is backwards.

That's something I already answered to you. You can enable it using setlocal EnableDelayedExpansion. The script only reports the default setting. E.g. if you run a script via double click then delayed expansion is initially disabled.


I'm too tired to work on the script today. I will do the corrections tomorrow...

Steffen

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Creating a script to gather PC information - to assist those asking for help

#122 Post by dbenham » 08 Sep 2016 18:39

aGerman wrote:@Dave
I think if we create a script of a thousand lines of code nobody would ever run it :lol: Douglas already suggested to have some specific scripts up our sleeves. Your suggestions could be part of those scripts. The original intention was to point out the basic differences. Maybe it's already a bit overdone.
I agree, which is why I suggested that TestOverride.bat and FastTestOverride.bat could be companion scripts.

But I still think you should consider adapting your script to use the %__APPDIR__% variable for locating core executables.

And displaying the value of %__APPDIR__% and %PATHEXT% takes minimal code, yet can be very useful for diagnosing problems that occasionally crop up.

Regardless, the utility is shaping up to be a fine piece of work.

----------------

Regarding my problems with CHCP 1252 on my Win 10 machine...

I did some more tests, and when my Win 10 console is configured to use the new features, and when my active code page is 1252, then I cannot set my console font to "Raster Fonts", regardless which size I select. The "Raster Fonts" option is there, and I can select a size like 8x12, but when I press OK, the display does not change to a Raster Font. When I then reopen the console properties, I see that the font has defaulted back to "Courier New".

If I configure the console to "Use legacy console", then the 1252 code page does not prevent me from using Raster Fonts.


Dave Benham

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#123 Post by aGerman » 09 Sep 2016 11:18

Of course Dave. I only referred to your separate scripts :)
Okay I hope I didn't forget something
viewtopic.php?f=3&t=7347&p=48700#p48700

Code: Select all

--------------------------------------------------------------------------------
Windows version        :  Microsoft Windows [Version 10.0.10586]
Product name           :  Windows 10 Home, 32 bit
Performance indicators :  Processor Cores: 4      Visible RAM: 2023612 kilobytes

Date/Time format       :  (dd/mm/yy)  09.09.2016  19:11:15,70
__APPDIR__             :  C:\WINDOWS\system32\
ComSpec                :  C:\WINDOWS\system32\cmd.exe
PathExt                :  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Extensions             :  system: Enabled   user: Enabled
Delayed expansion      :  system: Disabled  user: Disabled
Locale name            :  de-DE       Code Pages: OEM  850    ANSI 1252
DIR  format            :  04.09.2016  16:45       738.197.504 pagefile.sys
Permissions            :  Elevated Admin=No, Admin group=Yes



I visited a friend of mine. He works with Win 10 x64.
His output:

Code: Select all

--------------------------------------------------------------------------------
Windows version        :  Microsoft Windows [Version 10.0.10586]
Product name           :  Windows 10 Home, 64 bit
Performance indicators :  Processor Cores: 4      Visible RAM: 3857100 kilobytes

Date/Time format       :  (dd/mm/yy)  09.09.2016  17:49:19,49
__APPDIR__             :  C:\WINDOWS\system32\
ComSpec                :  C:\WINDOWS\system32\cmd.exe
PathExt                :  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Extensions             :  system: Enabled   user: Enabled
Delayed expansion      :  system: Disabled  user: Disabled
Locale name            :  de-DE       Code Pages: OEM  850    ANSI 1252
DIR  format            :  27.08.2016  13:35     4.026.531.840 pagefile.sys
Permissions            :  Elevated Admin=No, Admin group=Yes
 
                          Missing from the tool collection:  debug


We changed his default font to raster font 8 x 12. CHCP 1252 did not affect it :|

Steffen

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Creating a script to gather PC information - to assist those asking for help

#124 Post by dbenham » 10 Sep 2016 06:56

Looks great :)

Are you sure your friends console is not configured to use the legacy console? If so, then I am really puzzled.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#125 Post by aGerman » 10 Sep 2016 07:05

dbenham wrote:Looks great :)

I'm happy if you are, Dave :D

dbenham wrote:Are you sure your friends console is not configured to use the legacy console?

Yes I verified that too. The box was unchecked.

Steffen

douglas.swehla
Posts: 75
Joined: 01 Jun 2016 09:25

Re: Creating a script to gather PC information - to assist those asking for help

#126 Post by douglas.swehla » 10 Sep 2016 17:44

aGerman wrote:@Douglas
I've noticed that all the results posted so far report that delayed expansion is disabled for both the system and the user. That seems unlikely, and I think it's because the test is backwards.

That's something I already answered to you. You can enable it using setlocal EnableDelayedExpansion. The script only reports the default setting. E.g. if you run a script via double click then delayed expansion is initially disabled.
Steffen


My bad. I spent so long thinking about the admin elevation problem that I mixed it up with this one, and got the idea that the delayed expansion registry setting was about permissions, rather than defaults. I was thinking that an administrator could prevent users from enabling DX, so that setlocal enableDelayedExpansion would have no more effect than just setlocal by itself. It's silly once I stop and think about it. Carry on :)

-Douglas

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#127 Post by aGerman » 17 Sep 2016 05:55

After another week of waiting for further suggestions or bug reports I decided to append the script to the sticky post
http://www.dostips.com/forum/viewtopic.php?f=3&t=6108&p=49091#p49091
Thank you all for your support!

Steffen

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Creating a script to gather PC information - to assist those asking for help

#128 Post by dbenham » 17 Sep 2016 08:29

Great :!:

You should include sample output in your sticky thread. This might help alleviate any concerns people might have.

You already attempt to describe the output of the script, but a picture is worth a thousand words.


Dave Benham

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#129 Post by aGerman » 17 Sep 2016 09:12

Thanks Dave!

I included an example as you suggested.

Steffen

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#130 Post by aGerman » 19 Sep 2016 12:51

foxidrive told me that he gets an "empty"

Code: Select all

                          Missing from the PATH environment: 

Does anybody else get this output? I have no idea why this could happen :?

Steffen

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: Creating a script to gather PC information - to assist those asking for help

#131 Post by Compo » 19 Sep 2016 13:35

I get this:

Code: Select all

                          Missing from the PATH environment: 
                          Missing from the tool collection:  debug
Why? am I or foxi for that matter, supposed to have something missing from there? or is that line only supposed to appear if there is something missing?

I can only guess that line: 212 isn't evaluating as you'd expected.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#132 Post by aGerman » 19 Sep 2016 13:57

The second line is okay because debug.exe doesn't exist on 64bit systems and most of the newer 32bit systems. The first line should only appear if at least one of "C:\Windows", "C:\Windows\System32", "C:\Windows\System32\wbem", or "C:\Windows\System32\WindowsPowerShell\v1.0" is missing.

I think I found the bug though. The above is specified as follows:
set dirs="%SystemRoot%","%SystemRoot\System32%","%__APPDIR__%wbem","%__APPDIR__%WindowsPowerShell\v1.0"

Funny enough it works for me and also on any other machine I tested so far :lol:

Steffen

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: Creating a script to gather PC information - to assist those asking for help

#133 Post by Compo » 19 Sep 2016 15:07

yep that's done it, changed line 48 accordingly and now does not show the line as expected.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Creating a script to gather PC information - to assist those asking for help

#134 Post by aGerman » 19 Sep 2016 15:42

Thanks for testing!
Already updated the script meanwhile.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Creating a script to gather PC information - to assist those asking for help

#135 Post by foxidrive » 20 Sep 2016 07:15

Is this expected?

I have three machines shown here that use an admin account and with UAC disabled.

The Windows 8.1 at the bottom has Elevated Admin=No, Admin group=Yes
while the other two have Elevated Admin=Yes, Admin group=Yes

I have consumed too many bottles of vodka to figure it out for myself. ;)


Code: Select all

--------------------------------------------------------------------------------
Windows version        :  Microsoft Windows [Version 6.1.7601]
Product name           :  Windows 7 Professional, 64 bit
Performance indicators :  Processor Cores: 4      Visible RAM: 4072496 kilobytes

Date/Time format       :  (dd/mm/yy)  Tue 20/09/2016  22:18:34.75
__APPDIR__             :  C:\Windows\system32\
ComSpec                :  C:\Windows\system32\cmd.exe
PathExt                :  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Extensions             :  system: Enabled   user: Enabled
Delayed expansion      :  system: Disabled  user: Disabled
Locale name            :  en-AU       Code Pages: OEM  850    ANSI 1252
DIR  format            :  18/09/2016  01:14 AM     4,170,235,904 pagefile.sys
Permissions            :  Elevated Admin=Yes, Admin group=Yes

                          Missing from the tool collection:  debug


Code: Select all

--------------------------------------------------------------------------------
Windows version        :  Microsoft Windows [Version 6.1.7601]
Product name           :  Windows 7 Ultimate, 32 bit
Performance indicators :  Processor Cores: 4      Visible RAM: 3530224 kilobytes

Date/Time format       :  (dd/mm/yy)  Tue 20/09/2016  22:25:24.01
__APPDIR__             :  C:\Windows\system32\
ComSpec                :  C:\Windows\system32\cmd.exe
PathExt                :  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Extensions             :  system: Enabled   user: Enabled
Delayed expansion      :  system: Disabled  user: Disabled
Locale name            :  en-AU       Code Pages: OEM  850    ANSI 1252
DIR  format            :  13/09/2016  02:41 PM     3,614,949,376 pagefile.sys
Permissions            :  Elevated Admin=Yes, Admin group=Yes



Code: Select all

--------------------------------------------------------------------------------
Windows version        :  Microsoft Windows [Version 6.3.9600]
Product name           :  Windows 8.1 Pro with Media Center, 32 bit
Performance indicators :  Processor Cores: 8      Visible RAM: 3390680 kilobytes

Date/Time format       :  (dd/mm/yy)  Tue 20/09/2016  22:17:04.09
__APPDIR__             :  C:\WINDOWS\system32\
ComSpec                :  C:\WINDOWS\system32\cmd.exe
PathExt                :  .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Extensions             :  system: Enabled   user: Enabled
Delayed expansion      :  system: Disabled  user: Disabled
Locale name            :  en-AU       Code Pages: OEM  850    ANSI 1252
DIR  format            :  12/09/2016  18:40     3,484,418,048 pagefile.sys
Permissions            :  Elevated Admin=No, Admin group=Yes


Post Reply