Jump to content
Sign in to follow this  
chiners_68

Script help

Recommended Posts

chiners_68

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)

Share this post


Link to post
Share on other sites
jvanegmond

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

Share this post


Link to post
Share on other sites
chiners_68

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

Share this post


Link to post
Share on other sites
chiners_68

just spoted this macro does OS architecture.

@OSArch

Share this post


Link to post
Share on other sites
jvanegmond

I wouldn't know why you would read processor architecture from the registry when you want to get the OS architecture ..... ;)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.