Jump to content

Recommended Posts

Posted

Hi Guys,

have set this up in *.vbs but need to run in autoit. How do you deal with a constant & how do i get the constant to work in the message box. i have the vbcode & what i have with autoit but the auto it dosent work.

VB code

On Error Resume Next
DIM strOStype
Set WshShell = CreateObject("WScript.Shell")

strOsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
wscript.echo "OS Type = " & strostype

AutoIT

OStype = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\", "PROCESSOR_ARCHITECTURE")
MsgBox(0, "OS Type", OStype, 5)
Posted (edited)

4 things you're doing wrong:

1. Mistake constant for a variable. Quite the opposite.

2. Call the processor architecture the OS type (and confuse their meanings)

3. Have a syntax error in your script because you forgot $ in front of OStype

$OStype = RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\", "PROCESSOR_ARCHITECTURE")
MsgBox(0, "Processor architecture", $OStype, 5)

4. Don't use the easier way:

MsgBox(0, "Processor architecture", @CPUArch)

That would be all.

Edited by Manadar
Posted

thanks mandar,

wasnt aware of a macro for Processor Architecture.

I want OS type & the only way to check that is with the reg key so ill stick with that for now..

thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...