Creating a script to gather PC information - to assist those asking for help
Moderator: DosItHelp
Re: Creating a script to gather PC information - to assist those asking for help
Thanks elzooilogico!
Since XP is still a walking dead but PS wasn't available on some XP versions I would rather avoid to use PS.
The RunAs variable shall indicate whether or not the script was run with elevated administrative permissions (such as usually would be done via right clicking and selecting "Run as Administrator").
Perhaps I should simply leave out the additional registry check
Steffen
Since XP is still a walking dead but PS wasn't available on some XP versions I would rather avoid to use PS.
The RunAs variable shall indicate whether or not the script was run with elevated administrative permissions (such as usually would be done via right clicking and selecting "Run as Administrator").
Perhaps I should simply leave out the additional registry check
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
@foxidrive
Would you mind telling me if that works correctly on your Win8.1?
Steffen
Code: Select all
@echo off &setlocal
net session >nul 2>&1 && (ECHO set "RunAs=Yes") || (ECHO set "RunAs=No")
pause
Would you mind telling me if that works correctly on your Win8.1?
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
aGerman wrote:Would you mind telling me if that works correctly on your Win8.1?
I see this:
Code: Select all
set "RunAs=Yes"
Press any key to continue . . .
Re: Creating a script to gather PC information - to assist those asking for help
Thanks! Er ... and that was with your origin settings or with the settings elzooilogico provided? (If I would have left out the redirections to NUL I would already know it )
Steffen
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
No worries. Now that the registry edit is in place it will stay there.
It's with the new setting that gives Elevated Admin=Yes
It's with the new setting that gives Elevated Admin=Yes
Code: Select all
INFO.BAT version 1.2
--------------------------------------------------------------------------------
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) Sat 24/09/2016 15:04:06.32
__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 : 24/09/2016 13:24 3,484,418,048 pagefile.sys
Permissions : Elevated Admin=Yes, Admin group=Yes
Re: Creating a script to gather PC information - to assist those asking for help
Thanks foxidrive!
I will change the script. Relying on NET SESSION should be sufficient.
Steffen
I will change the script. Relying on NET SESSION should be sufficient.
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
I am just starting to put a newly acquired LattePanda Windows 10 mini-PC through its paces.
INFO.bat gave me an exception in the PATH:
I added the full actual PATH manually.
I noticed a more current version and re-ran:
I thought that the path was always terminated with a ";". Is this a problem for INFO.bat or for my system?
Thanks,
John A.
INFO.bat gave me an exception in the PATH:
Code: Select all
INFO.BAT version 1.2
--------------------------------------------------------------------------------
Windows version : Microsoft Windows [Version 10.0.10586]
Product name : Windows 10 Home, 64 bit
Performance indicators : Processor Cores: 4 Visible RAM: 4116580 kilobytes
Date/Time format : (mm/dd/yy) Wed 01/04/2017 17:35:59.63
__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-US Code Pages: OEM 437 ANSI 1252
DIR format : 01/04/2017 04:42 PM 1,476,395,008 pagefile.sys
Permissions : Elevated Admin=No, Admin group=Yes
Missing from the PATH environment: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Missing from the tool collection: debug
Actual Path : PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
I added the full actual PATH manually.
I noticed a more current version and re-ran:
Code: Select all
INFO.BAT version 1.3
--------------------------------------------------------------------------------
Windows version : Microsoft Windows [Version 10.0.10586]
Product name : Windows 10 Home, 64 bit
Performance indicators : Processor Cores: 4 Visible RAM: 4116580 kilobytes
Date/Time format : (mm/dd/yy) Wed 01/04/2017 18:01:37.47
__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-US Code Pages: OEM 437 ANSI 1252
DIR format : 01/04/2017 04:42 PM 1,476,395,008 pagefile.sys
Permissions : Elevated Admin=No, Admin group=Yes
Missing from the PATH environment: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Missing from the tool collection: debug
Thanks,
John A.
Re: Creating a script to gather PC information - to assist those asking for help
Thank you John! Fixed with version 1.4.
Steffen
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
Would it be useful to display the following info:
- windows language
- keyboard language settings
I mean: I have English Windows but I use Slovenian keyboard layout. Maybe this information might be useful.
Saso
- windows language
- keyboard language settings
I mean: I have English Windows but I use Slovenian keyboard layout. Maybe this information might be useful.
Saso
Re: Creating a script to gather PC information - to assist those asking for help
I'm not sure, Saso. What unusual behavior are you facing with the settings you have? I mean, if that's rather unrelated to the execution of bach scripts, then we may not need this information.
(I just want to avoid gathering arbitrary information that are not even useful for our purpose. Keep in mind that we are asking users to publish their results in the forum. The script shall only help the volunteers in this forum to provide better help to the questioners.)
Steffen
(I just want to avoid gathering arbitrary information that are not even useful for our purpose. Keep in mind that we are asking users to publish their results in the forum. The script shall only help the volunteers in this forum to provide better help to the questioners.)
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
I thought of that based on this https://www.ghisler.ch/board/viewtopic.php?f=32&t=73738 .
I had a problem with copy/paste (as I see it internal copy/paste to Total Commander) when my national letters (ČŠŽ) were changed (not copied correctly) on one computer. I thought maybe this (English Windows XP, Slovenia keyboard layour and regional settings) could be the reason. That is why I proposed this. I don't think this would reveal any sensitive 'personal' information of the user executing info.bat (maybe location based on the language - but there are many countries with the same language so this might not be the case).
Thanks.
Saso
I had a problem with copy/paste (as I see it internal copy/paste to Total Commander) when my national letters (ČŠŽ) were changed (not copied correctly) on one computer. I thought maybe this (English Windows XP, Slovenia keyboard layour and regional settings) could be the reason. That is why I proposed this. I don't think this would reveal any sensitive 'personal' information of the user executing info.bat (maybe location based on the language - but there are many countries with the same language so this might not be the case).
Thanks.
Saso
Re: Creating a script to gather PC information - to assist those asking for help
The locale name is already part of the collected information (even if the script doesn't seem to be able to find it on your XP machine). This is of interest because of the localized output of most of the commands. Also the output format of automatic variables like %date% is somewhat related. However, clipboard handling is a completely different story. I can't think of any problems that are related to problems with the behavior of Batch scripts. Handling clipboard data correctly is in the responsibily of the applications. And the keyboard layout is again a different story where I'm not even sure whether or not problems with the clipboard are somehow related. However, the keyboard layout is a can of worms. Not only that the behavior changed on Win8 onwards, applications are responsible to react properly to updates during runtime. Eventually we might not even be able to rely on those informations.
Steffen
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
I noticed one small glitch on line 129:
Shouldn't that be (%%i) as in:
Code: Select all
if not defined OEMCP for /f "tokens=*" %%i in ('%chcp%') do for %%j in (%%j) do set "OEMCP=%%~nj"
Code: Select all
if not defined OEMCP for /f "tokens=*" %%i in ('%chcp%') do for %%j in (%%i) do set "OEMCP=%%~nj"
Re: Creating a script to gather PC information - to assist those asking for help
What a silly typo
Update is published. Thanks!
Steffen
Update is published. Thanks!
Steffen
Re: Creating a script to gather PC information - to assist those asking for help
I know this script takes into account whether WMIC is installed. However, are there plans to adjust it to account for the eventual removal of WMIC in Windows 11?