Author Topic: System Info of windows  (Read 7344 times)

0 Members and 1 Guest are viewing this topic.

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #15 on: November 02, 2020, 02:38:48 pm »
Quick question, what do you need the windows version for?

Application behavior sometimes changes when run on windows7 or windows10.
The OS are similar but certainly not the same and every now and then you find some surprises so it is useful to predict these critical issues.

« Last Edit: November 02, 2020, 02:43:02 pm by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #16 on: November 02, 2020, 02:42:47 pm »
Man if it's not in here?
Code: QB64: [Select]
  1.   i = i + 1
  2.   setting$ = ENVIRON$(i) ' get a setting from the list
  3.   PRINT setting$
  4.   IF i MOD 20 = 0 THEN PRINT "Press a key": SLEEP: CLS
  5. LOOP UNTIL setting$ = ""
  6.  

The behavior of ENVIRON$() is different in the two systems (win10 and win7) and the result seems unreliable.
At least that's what I've checked several times on multiple machines.

QB64 probably lacks a function that simply returns (in any OS) the OS, version and even the user's name and his folder.

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #17 on: November 02, 2020, 02:45:01 pm »
@krovit I have some new code posted here that makes the Windows version operate better. No more console window popping up.

https://www.qb64.org/forum/index.php?topic=3168.msg124345#msg124345

Thank you! I consider it immediately for my applications...
« Last Edit: November 02, 2020, 02:47:00 pm by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: System Info of windows
« Reply #18 on: November 02, 2020, 03:45:06 pm »
Well this works for 10, how 'bout 7?
Code: QB64: [Select]
  1. SHELL "ver > ver.txt"
  2. OPEN "ver.txt" FOR BINARY AS #1
  3. ver$ = SPACE$(LOF(1))
  4. GET #1, , ver$
  5. PRINT ver$
  6. PRINT MID$(ver$, INSTR(LCASE$(ver$), "version") + LEN("version "), 2) 'modify as needed
  7.  

@krovit  Same as Steve, no batch file is involved. So wth? are you just being difficult? ;-))

PS I never knew my widows version was so many characters long! ;-)
« Last Edit: November 02, 2020, 03:54:23 pm by bplus »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: System Info of windows
« Reply #19 on: November 02, 2020, 04:19:26 pm »
@bplus He also mentioned he was hoping to not have to write to a file at all.
Shuwatch!

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #20 on: November 02, 2020, 04:21:46 pm »
Well this works for 10, how 'bout 7?
Code: QB64: [Select]
  1. SHELL "ver > ver.txt"
  2. OPEN "ver.txt" FOR BINARY AS #1
  3. ver$ = SPACE$(LOF(1))
  4. GET #1, , ver$
  5. PRINT ver$
  6. PRINT MID$(ver$, INSTR(LCASE$(ver$), "version") + LEN("version "), 2) 'modify as needed
  7.  

@krovit  Same as Steve, no batch file is involved. So wth? are you just being difficult? ;-))

PS I never knew my widows version was so many characters long! ;-)

I'm afraid I don't understand (OT: ah! foreign languages... i'm not able to talk it... I only speak Italian, and I would hope well... it is a beautiful language, with 250 thousand words! and we use 2000 and no; inside is especially Latin and Ancient Greek, and then German, Spanish, French... lastly also English (imported as it is, but then it's not really "Italian language") and one thing we can say in a thousand ways and a thousand nuances).

The code for the batch file is fine just and it works in the two OS but forces to access the disk and if you can avoid it seems better.

« Last Edit: November 02, 2020, 04:25:40 pm by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: System Info of windows
« Reply #21 on: November 02, 2020, 05:05:56 pm »
Code: QB64: [Select]
  1. save$ = _CLIPBOARD$
  2. SHELL "ver | clip" ' << I AM NOT A FREAKIN BAT FILE!  ;-))
  3. _CLIPBOARD$ = save$
  4. PRINT ver$
  5.  

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #22 on: November 03, 2020, 02:53:53 am »
Code: QB64: [Select]
  1. save$ = _CLIPBOARD$
  2. SHELL "ver | clip" ' << I AM NOT A FREAKIN BAT FILE!  ;-))
  3. _CLIPBOARD$ = save$
  4. PRINT ver$
  5.  

Thank you BPlus this latest version is very, very nice and works (I have to test it on win7 to catch the differences with win10).
The previous truths, however, made use of a file (SHELL "ver > ver.txt" / OPEN "ver.txt" FOR BINARY AS #1 etc..)

Anyway... i can't understand the trick, which is how it can work...


« Last Edit: November 03, 2020, 02:55:55 am by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #23 on: November 03, 2020, 03:30:49 am »
https://jrsoftware.org/ishelp/index.php?topic=winvernotes

6.0.6000   Windows Vista
6.0.6001   Windows Vista with Service Pack 1 'or Windows Server 2008
6.1.7600   Windows 7 'or Windows Server 2008 R2
6.1.7601   Windows 7 with Service Pack 1 'or Windows Server 2008 R2 with Service Pack 1
6.2.9200   Windows 8 'or Windows Server 2012
6.3.9200   Windows 8.1 'or Windows Server 2012 R2
6.3.9600   Windows 8.1 with Update 1
10.0.10240   Windows 10 Version 1507
10.0.10586   Windows 10 Version 1511 (November Update)
10.0.14393   Windows 10 Version 1607 (Anniversary Update) 'or Windows Server 2016
10.0.15063   Windows 10 Version 1703 (Creators Update)
10.0.16299   Windows 10 Version 1709 (Fall Creators Update)
10.0.17134   Windows 10 Version 1803 (April 2018 Update)
10.0.17763   Windows 10 Version 1809 (October 2018 Update) 'or Windows Server 2019
10.0.18362   Windows 10 Version 1903 (May 2019 Update)
10.0.18363   Windows 10 Version 1909 (November 2019 Update)
10.0.19041   Windows 10 Version 2004 (May 2020 Update)
Note that there is normally no need to specify the build numbers (i.e., you may simply use "6.2" for Windows 8)

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: System Info of windows
« Reply #24 on: November 03, 2020, 08:44:52 am »
Thank you BPlus this latest version is very, very nice and works (I have to test it on win7 to catch the differences with win10).
The previous truths, however, made use of a file (SHELL "ver > ver.txt" / OPEN "ver.txt" FOR BINARY AS #1 etc..)

Anyway... i can't understand the trick, which is how it can work...
@krovit Just remember that by piping to clip it slows down the command sometimes to being 1/3 the speed of a regular SHELL or pipecom.
Shuwatch!

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #25 on: November 03, 2020, 09:00:52 am »
@krovit Just remember that by piping to clip it slows down the command sometimes to being 1/3 the speed of a regular SHELL or pipecom.

Ahhgh!!!

We say (in Italy, in your areas i don't know...): "give me a hot and a cold one", or even "a crush and a raw one"... to indicate that every time there is something that contradicts the previous time...
« Last Edit: November 03, 2020, 09:05:11 am by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: System Info of windows
« Reply #26 on: November 03, 2020, 09:56:57 am »
Ahhgh!!!

We say (in Italy, in your areas i don't know...): "give me a hot and a cold one", or even "a crush and a raw one"... to indicate that every time there is something that contradicts the previous time...

Instead of sighing I would demand proof ;-)) specially if clipboard is cleared before piping. :O

Besides what's 1/3 or .001, you only do it once, sip some coffee ;-))
« Last Edit: November 03, 2020, 10:06:08 am by bplus »

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: System Info of windows
« Reply #27 on: November 03, 2020, 10:35:49 am »
Instead of sighing I would demand proof ;-)) specially if clipboard is cleared before piping. :O

Besides what's 1/3 or .001, you only do it once, sip some coffee ;-))

I actually did a lot of rehearsals and I can't notice the difference, in terms of the time spent.
But I am a perfectionist (that's why I can't finish my projects... a classic!) and I know that if I leave something there, settle for something there, pretend I don't see it that way... eventually the difference you'll see.

Optimizing your code is critical for any project...


« Last Edit: November 03, 2020, 10:37:38 am by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: System Info of windows
« Reply #28 on: November 03, 2020, 11:10:18 am »
I actually did a lot of rehearsals and I can't notice the difference, in terms of the time spent.
But I am a perfectionist (that's why I can't finish my projects... a classic!) and I know that if I leave something there, settle for something there, pretend I don't see it that way... eventually the difference you'll see.

Optimizing your code is critical for any project...


My philosophy is:

FIRST get it working, then get it working right THEN get it optimized.

Because we all know it's never going to be perfect unless it's math ;-))
Quote
(that's why I can't finish my projects... a classic!)

Really no sense in optimizing excrement ;-))
« Last Edit: November 03, 2020, 11:29:55 am by bplus »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: System Info of windows
« Reply #29 on: November 03, 2020, 04:22:11 pm »
@krovit I have updated the code for pipecom here:
https://www.qb64.org/forum/index.php?topic=3168.0

There was a bug that caused data duplication.
Shuwatch!