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 


Retrive if Windows is 32bit or 64bit [SOLVED]

 
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 Nov 04, 2010 11:54 pm    Post subject: Retrive if Windows is 32bit or 64bit [SOLVED] Reply with quote

Hi guyz Smile

It's possible and how know if Windows is 32bit or 64bit?

Many tnx


Last edited by Tdk161 on Fri Nov 05, 2010 6:24 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Fri Nov 05, 2010 12:15 am    Post subject: Reply with quote

This is code vdsalchemist posted awhile back. You use the IsWow64Process to determine if your 32bit application is runing under WOW64 (on a 64-bit OS)

msdn: http://msdn.microsoft.com/en-us/library/ms684139(VS.85).aspx


Code:

#-----------------------------------------------------------------------------#
#                                                                             #
# A function that determines if you are using a 64bit version of windows.     #
#                                                                             #
# Author: Johnny Kinsey                                                       #
#                                                                             #
# Copyright: Copyright © 2007 DragonSphere Software                           #
#                                                                             #
#-----------------------------------------------------------------------------#

#DEFINE FUNCTION,WIN64

If @Win64()
  Info Your are using a 64bit version of Windows
Else
  Info You are using a 32bit version of Windows.
End

Stop

:WIN64
%R =
%%MajorVersion = @SubStr(@SysInfo(WinVer),1,1)
If @Greater(%%MajorVersion,4)
  LoadLib kernel32.dll
  %B = @BINARY(DWORD,0)
  %H = @lib(kernel32,GetCurrentProcess,INT:)
  %A = @lib(kernel32,IsWow64Process,BOOL,INT:%H,INT:@addr("%B"))
  %B = @val(@substr(%B,1,4))
  If @Equal(%B,1)
    %R = 1
  End
  FreeLib kernel32
End
Exit %R

Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Nov 05, 2010 6:28 am    Post subject: Reply with quote

Hi Pgware

Work fine (I think) I can test only on 32 bit system No clue
and many thanks for your help Very Happy
Back to top
View user's profile Send private message Send e-mail
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