Sign in to follow this  
Followers 0
pantz

Dell Computer type read If statement

10 posts in this topic

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

@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

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

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

If StringInString($var,"Latitude") Then

Gives me: error: unknown function name.

Share this post


Link to post
Share on other sites

That was it. Thanks!!

Share this post


Link to post
Share on other sites

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

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  
Followers 0