Jump to content
Sign in to follow this  
pantz

Dell Computer type read If statement

Recommended Posts

pantz

I am having a problem with this statement. I think it is a very simple error but I don't see whats wrong.

Of course I am building an If then statement if it is going to be a laptop then I it will install the wireless client.

Anyone have something like that built already?

Thanks,

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\Sysinfo", "Model")

If $var = "Latitude D620" Then

MsgBox(4096, "You have a...", $var)

Else

MsgBox(4096, "You have a...", "desktop.")

EndIf

Share this post


Link to post
Share on other sites
Jos

Try: $var = StringStripWS(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\Sysinfo", "Model"),3)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
DjDeep00

@pantz...First check to see what value $var is by using a message box like this..

MsgBox(4096,"",$var)

If you get a blank value then the reg path you are reading is incorrect.

Search the forums...i think many people have made scripts that collect computer hardware information....

Share this post


Link to post
Share on other sites
pantz

Thanks Jos!! That fixed it. Now I will try putting in the rest of my code for installing the wireless client and give it a try!

Share this post


Link to post
Share on other sites
DirtDBaK

If $var = "Latitude D620" Then

You may want to use

If StringInString($var,"Latitude") Then

That way any model of a 'Latitude' will work with your script


[center][/center]

Share this post


Link to post
Share on other sites
pantz

If StringInString($var,"Latitude") Then

Gives me: error: unknown function name.

Share this post


Link to post
Share on other sites
pantz

Here is my script.. If it is a latitude it will run the wireless. If a desktop then it will not. This script is in my sysprep.

$var = StringStripWS(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\Sysinfo", "Model"),3)

WinWaitActive("System Settings Change")

Send("!n")

If StringInStr($var,"Latitude") Then

RunWait("c:\dell\drivers\Dellwireless.exe")

;MsgBox(4096, "You have a...", $var)

EndIf

RunWait("c:\dell\drivers\FramePkg.exe")

WinActive("McAfee Agent and Updater Setup","Setup completed successfully.")

Send ("{ESC}")

RunWait("c:\dell\drivers\ghost\install.cmd")

WinWaitClose("C:\Windows\System32\cmd.exe")

Runwait( @comspec & " /c "& "regedit /s c:\dell\drivers\secondboot.reg")

RunWait("shutdown.exe -r -t 60")

Share this post


Link to post
Share on other sites
DirtDBaK

lol I meant stringinstr, aha... glad it works for you..

And do you use the help file?


[center][/center]

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.