forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cpu type

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Thu Feb 01, 2018 4:43 am    Post subject: Cpu type Reply with quote

Hi,
how know the cpu type? x86 or x64?, It's possible? How?
Thank you
Back to top
View user's profile Send private message Send e-mail
GregLand
Valued Contributor
Valued Contributor


Joined: 15 Jun 2004
Posts: 212
Location: FRANCE

PostPosted: Thu Feb 01, 2018 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Thu Feb 01, 2018 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Feb 02, 2018 9:02 pm    Post subject: Reply with quote

Very Happy 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 Sad
Thank you again Smile


Last edited by Tdk161 on Fri Feb 02, 2018 9:10 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Fri Feb 02, 2018 9:07 pm    Post subject: Reply with quote

That's very odd. I have never had an issue. I use that all the time and even work on a 64 bit system. Sad
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GregLand
Valued Contributor
Valued Contributor


Joined: 15 Jun 2004
Posts: 212
Location: FRANCE

PostPosted: Sat Feb 03, 2018 11:05 am    Post subject: Reply with quote

I don't know why, but I never managed to get @sysinfo(win32) to work.
Always return 32bit… Crying or Very sad

That's why I created my own DSU.
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Sat Feb 03, 2018 2:12 pm    Post subject: Reply with quote

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. Confused, angry
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
GregLand
Valued Contributor
Valued Contributor


Joined: 15 Jun 2004
Posts: 212
Location: FRANCE

PostPosted: Sat Feb 03, 2018 2:55 pm    Post subject: Reply with quote

because run by an x86 application
that why I run a batch in my dsu and non the
ENV("PROCESSOR_ARCHITECTURE")
Back to top
View user's profile Send private message Visit poster's website
DanTheMan
Contributor
Contributor


Joined: 15 Mar 2002
Posts: 56
Location: Sweden

PostPosted: Mon Feb 26, 2018 2:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
GregLand
Valued Contributor
Valued Contributor


Joined: 15 Jun 2004
Posts: 212
Location: FRANCE

PostPosted: Mon Feb 26, 2018 3:10 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group