View previous topic :: View next topic |
Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Thu Feb 01, 2018 4:43 am Post subject: Cpu type |
|
|
Hi,
how know the cpu type? x86 or x64?, It's possible? How?
Thank you |
|
Back to top |
|
 |
GregLand Valued Contributor


Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Thu Feb 01, 2018 10:50 am Post subject: |
|
|
Hi
Try this : (should work on all windows, but tried only on Windows 10)
Code: | #define function,cpu_archi
INFO @cpu_archi()
EXIT
:cpu_archi
%%sdfgsdf = @new(LIST)
LIST loadtext,%%sdfgsdf,
"IF %PROCESSOR_ARCHITECTURE% == x86 (IF NOT DEFINED PROCESSOR_ARCHITEW6432 goto bit86)
"goto bit64
":bit86
"echo archi>86.txt
":bit64
"echo archi>64.txt
"del temp.bat
LIST savefile,%%sdfgsdf,@path(%0)temp.bat
RUNH @path(%0)temp.bat,wait
LIST close,%%sdfgsdf
IF @FILE(64.txt)
%E = x64
ELSIF @FILE(86.txt)
%E = x86
ELSE
%E = NA
END
FILE delete,86.txt
FILE delete,64.txt
EXIT %E |
|
|
Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1752 Location: Space and Time
|
Posted: Thu Feb 01, 2018 2:26 pm Post subject: |
|
|
You can use @sysinfo(). I am using VDS6, not sure if it is on other VDS versions, I don't remember.
%t = @sysinfo(win32)
Will return 1 if running on a 32 bit version of windows. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Feb 02, 2018 9:02 pm Post subject: |
|
|
Hi,
Thank you very much for your solutions, but only GregLand's solution works fine, Liquidcode's suggestion return always 32bit processor on a 64bit cpu
Thank you again 
Last edited by Tdk161 on Fri Feb 02, 2018 9:10 pm; edited 1 time in total |
|
Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1752 Location: Space and Time
|
Posted: Fri Feb 02, 2018 9:07 pm Post subject: |
|
|
That's very odd. I have never had an issue. I use that all the time and even work on a 64 bit system.  _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
 |
GregLand Valued Contributor


Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Sat Feb 03, 2018 11:05 am Post subject: |
|
|
I don't know why, but I never managed to get @sysinfo(win32) to work.
Always return 32bit…
That's why I created my own DSU. |
|
Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1752 Location: Space and Time
|
Posted: Sat Feb 03, 2018 2:12 pm Post subject: |
|
|
That is so crazy. Even info @ENV("PROCESSOR_ARCHITECTURE") returns x86 which is supposed to be the same a echo %PROCESSOR_ARCHITECTURE% which returns AMD64.  _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
 |
GregLand Valued Contributor


Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Sat Feb 03, 2018 2:55 pm Post subject: |
|
|
because run by an x86 application
that why I run a batch in my dsu and non the
ENV("PROCESSOR_ARCHITECTURE") |
|
Back to top |
|
 |
DanTheMan Contributor


Joined: 15 Mar 2002 Posts: 56 Location: Sweden
|
Posted: Mon Feb 26, 2018 2:52 pm Post subject: |
|
|
GregLand wrote: | Hi
Try this : (should work on all windows, but tried only on Windows 10)
Code: | #define function,cpu_archi
INFO @cpu_archi()
EXIT
:cpu_archi
%%sdfgsdf = @new(LIST)
LIST loadtext,%%sdfgsdf,
"IF %PROCESSOR_ARCHITECTURE% == x86 (IF NOT DEFINED PROCESSOR_ARCHITEW6432 goto bit86)
"goto bit64
":bit86
"echo archi>86.txt
":bit64
"echo archi>64.txt
"del temp.bat
LIST savefile,%%sdfgsdf,@path(%0)temp.bat
RUNH @path(%0)temp.bat,wait
LIST close,%%sdfgsdf
IF @FILE(64.txt)
%E = x64
ELSIF @FILE(86.txt)
%E = x86
ELSE
%E = NA
END
FILE delete,86.txt
FILE delete,64.txt
EXIT %E |
|
and Modified for VDS 5
#define function,cpu_archi
INFO @cpu_archi()
EXIT
:cpu_archi
LIST Create,1
LIST loadtext,1,
"IF %PROCESSOR_ARCHITECTURE% == x86 (IF NOT DEFINED PROCESSOR_ARCHITEW6432 goto bit86)
"goto bit64
":bit86
"echo archi>86.txt
":bit64
"echo archi>64.txt
"del temp.bat
LIST savefile,1,@path(%0)temp.bat
RUNH @path(%0)temp.bat,wait
LIST close,1
IF @FILE(64.txt)
%E = x64
ELSIF @FILE(86.txt)
%E = x86
ELSE
%E = NA
END
FILE delete,86.txt
FILE delete,64.txt
EXIT %E |
|
Back to top |
|
 |
GregLand Valued Contributor


Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Mon Feb 26, 2018 3:10 pm Post subject: |
|
|
Thanks! |
|
Back to top |
|
 |
|