Jump to content

Hi all, hopefully a quick question


Phil W
 Share

Recommended Posts

Hi everyone

Firstly let me say I only started learning this excellent tool yesterday so I'm by no means an advanced user. I have a good understanding of PHP which seems to be helping a fair amount.

I have a couple of questions though.

Im creating a basic program with GUI as my first project, and one of the items im pulling from the registry is the processor name.

$processor = RegRead ("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString")

It returns this when the ley is read.

$processor = Intel® Pentium® D CPU 3.20GHz

As you can see it has a lot of spaces before the word Intel. I have also tried this on other PC's and it does the same, although i'm not sure whether its the same amount pf spaces.

How can I tell AutoIt to remove the Spaces BEFORE the "I", not the ones after the "I"? (hope that makes sense)

My Next question is how can I stress the processor to 100% for say 5 Seconds and then get a reading of what speeds its running at in Mhz. I have checked the help file several times for info on this and I cant seem to find anything, please let me know if it is in there and where to be looking.

Many Thanks

*after previewing post I can see that the board is not putting the spaces in front of Intel® Pentium® D CPU 3.20GHz. But I hope you understand what I mean.

Link to comment
Share on other sites

The command you need here is StringStripWS (strip whitespace). Use StringStripWS ($processor, 1) to only remove leading whitespace.

As for stressing the processor, hmm. Maybe use a tight loop, adding 1 to a variable each iteration. You could use Adlib to break out of it after a specified time, and see what the variable value was.

ben

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...