DosTips.com

A Forum all about DOS Batch
It is currently 21 Jul 2017 20:34

All times are UTC-06:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 08 Jan 2017 08:58 
Offline

Joined: 08 Jan 2017 08:34
Posts: 3
After reading some tales from TFTS subreddit, I got intrigued, can I make something that'll log your system information?
Then I proceeded to search on Google, I found several programs. But I wanted to do it myself.

So here it is: https://github.com/intrnl/batchScripts/blob/master/batchInfo.bat

It logs your OS information, and also memory, video, sound, logical disk, network, printer, user accounts, installed programs, context menu handlers, running processes, services that are either started or stopped, system drivers and also Plug and Play devices.

The main idea is, that if your PC is in a critical state, this script can help you determine what's currently going on, although it can also be used for general system information by using the command-line arguments to alter the log file.

Any help from you guys is very much appreciated, thanks!


Last edited by stackoverflow on 21 Jan 2017 02:53, edited 2 times in total.

Top
   
PostPosted: 08 Jan 2017 10:02 
Offline
Expert

Joined: 22 Jan 2010 18:01
Posts: 2707
Location: Germany
Your script is highly language dependent.
Have a look at the first few lines of systeminfo on my PC:
Code: Select all
C:\Users\steffen>systeminfo

Hostname:                                      DESKTOP-2KLLDT9
Betriebssystemname:                            Microsoft Windows 10 Home
Betriebssystemversion:                         10.0.14393 Nicht zutreffend Build 14393
Betriebssystemhersteller:                      Microsoft Corporation
Betriebssystemkonfiguration:                   Eigenst√§ndige Arbeitsstation
Betriebssystem-Buildtyp:                       Multiprocessor Free
Registrierter Benutzer:                        steffen
Registrierte Organisation:
Produkt-ID:                                    00325-86334-25774-AAOEM
Urspr√ľngliches Installationsdatum:             04.10.2016, 03:28:08
Systemstartzeit:                               01.01.2017, 19:29:12
Systemhersteller:                              ASUSTeK COMPUTER INC.
Systemmodell:                                  T100TAF
Systemtyp:                                     X86-based PC

Not even one of your findstr filters would work here.

Steffen


Top
   
PostPosted: 09 Jan 2017 06:01 
Offline

Joined: 08 Jan 2017 08:34
Posts: 3
aGerman wrote:
Your script is highly language dependent.
Have a look at the first few lines of systeminfo on my PC:
Code: Select all
...

Not even one of your findstr filters would work here.

Steffen

Yeah, that's what I've been thinking actually. I've been trying to think of ways to overcome with that problem.

I've been thinking to use the following solution:http://stackoverflow.com/questions/22307698/reading-a-specific-line-in-a-text-file-to-a-variable-in-a-batch-file

Code: Select all
for /F "skip=4 delims=" %%i in (xprtest.txt) do if not defined xprvar set "xprvar=%%i"


The following code that I took from that solution will grab line 5 from "xprtest" text file.

But for now, I'll probably put up a sign that it wouldn't work on non-English language.
or that I could just stop using systeminfo altogether and use WMIC instead (there could still be chance of the localization thing happening though).


Last edited by stackoverflow on 12 Jan 2017 06:20, edited 1 time in total.

Top
   
PostPosted: 09 Jan 2017 07:11 
Offline
Expert

Joined: 22 Jan 2010 18:01
Posts: 2707
Location: Germany
Here are the links to a script and informations about its development.
viewtopic.php?f=3&t=7420
viewtopic.php?f=3&t=7347
Its purpose is NOT to collect as many informations as possible. It only gathers a few data in order to enable helpers here at DosTips to provide an appropriate solution...
It was a lot of investigation and efforts to make it run for several system preconditions.

Steffen


Top
   
PostPosted: 21 Jan 2017 02:59 
Offline

Joined: 08 Jan 2017 08:34
Posts: 3
Updated to 1.1

I moved everything that uses systeminfo to using WMIC now, I don't think there might be language issues but I put up a language code check just to make sure, although you could easily bypass this with the -d flag.
I rewrote the fetch part from scratch, allowing for the ability to skip certain part of the info fetch. Not sure how it would stand up to long-term use but at least it works for now.
Anyway since you can skip certain fetching, you can now do general system info log.

Have fun! :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: Quisquose and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited