Jump to content

Script help


Recommended Posts

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)
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...