Jump to content



Photo

How to limit my script by Processor ID


  • Please log in to reply
3 replies to this topic

#1 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 04 March 2007 - 02:36 PM

Hi. I wan't to limit my script only to work for my PC. So, as every CPU has a diferent ID No. I guess this could be the solution:
example:
If "CPU-ID" = "my CPU-ID" then else exit EndIf

I searched the help of A3, but haven't found anything related to WMI... :whistle:
therefore I can't find out what is my CPU ID, and what command leads to it...
any suggestion?







#2 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,265 posts

Posted 04 March 2007 - 02:49 PM

Well, if you want to lock your script if it executed on another computer, then you can just Write a Registry entry, and then every time check it, it the value not exists, then exit the script:

$MyCompID = 0x85686790780 $MyCompRead = RegRead("HKEY_CURRENT_USER\Software\MyScript", "MyCompID") If $MyCompRead <> $MyCompID Then Exit


And write to the registry HKEY_CURRENT_USER\Software\MyScript the value 0x85686790780, so this will be yours comp ID :whistle:

[color=#008000;]Using OS: Win 7 Professional[/color][color=#000000;],[/color] Using AutoIt Ver(s): 3.3.6.1 [color=#800080;]/[/color] 3.3.8.1

Posted Image AutoIt Russian Community

 

Posted ImageProjects: ATT - Application Translate Tool [color=#FF0000;][new][/color][color=#FF0000;]|[/color] BlockIt - Block files & folders [color=#FF0000;][new][/color][color=#FF0000;]|[/color] SIP - Selected Image Preview [color=#FF0000;][new][/color][color=#FF0000;]|[/color] SISCABMAN - SciTE Abbreviations Manager [color=#FF0000;][new][/color][color=#FF0000;]|[/color] AutoIt Path Switcher [color=#FF0000;]|[/color] AutoIt Menu for Opera! [color=#FF0000;]|[/color] YouTube Download Center! [color=#FF0000;]|[/color] Desktop Icons Restorator [color=#FF0000;]|[/color] Math Tasks [color=#FF0000;]|[/color] KeyBoard & Mouse Cleaner [color=#FF0000;]|[/color] CaptureIt - Capture Images Utility [color=#FF0000;]|[/color] CheckFileSize Program

 

Posted ImageUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [color=#FF0000;][new][/color][color=#FF0000;]|[/color] AutoIt Syntax Highlight [color=#FF0000;][new][/color][color=#FF0000;]|[/color] Opera Library! [color=#FF0000;]|[/color] Winamp Library [color=#FF0000;]|[/color] GetFolderToMenu [color=#FF0000;]|[/color] Custom_InputBox()! [color=#FF0000;]|[/color] _FileRun UDF [color=#FF0000;]|[/color] _CheckInput() UDF [color=#FF0000;]|[/color] _GUIInputSetOnlyNumbers() UDF [color=#FF0000;]|[/color] _FileGetValidName() UDF [color=#FF0000;]|[/color] _GUICtrlCreateRadioCBox UDF [color=#FF0000;]|[/color] _GuiCreateGrid() [color=#FF0000;]|[/color] _PathSplitByRegExp() [color=#FF0000;]|[/color] _GUICtrlListView_MoveItems - UDF [color=#FF0000;]|[/color] GUICtrlSetOnHover_UDF! [color=#FF0000;]|[/color] _ControlTab UDF! [color=#FF0000;]|[/color] _MouseSetOnEvent() UDF! [color=#FF0000;]|[/color] _ProcessListEx - UDF [color=#FF0000;]|[/color] GUICtrl_SetResizing - UDF! [color=#FF0000;]|[/color] Mod. for _IniString UDFs [color=#FF0000;]|[/color] _StringStripChars UDF [color=#FF0000;]|[/color] _ColorIsDarkShade UDF [color=#FF0000;]|[/color] _ColorConvertValue UDF [color=#FF0000;]|[/color] _GUICtrlTab_CoverBackground [color=#FF0000;]|[/color] CUI_App_UDF [color=#FF0000;]|[/color] _IncludeScripts UDF [color=#FF0000;]|[/color] _AutoIt3ExecuteCode [color=#FF0000;]|[/color] _DragList UDF [color=#FF0000;]|[/color] Mod. for _ListView_Progress [color=#FF0000;]|[/color] _ListView_SysLink [color=#FF0000;]|[/color] _GenerateRandomNumbers [color=#FF0000;]|[/color] _BlockInputEx [color=#FF0000;]|[/color] _IsPressedEx [color=#FF0000;]|[/color] OnAutoItExit Handler [color=#FF0000;]|[/color] _GUICtrlCreateTFLabel UDF [color=#FF0000;]|[/color] WinControlSetEvent UDF [color=#FF0000;]|[/color] Mod. for _DirGetSizeEx UDF

 

Posted ImageExamples: ScreenSaver Demo - Matrix included [color=#FF0000;]|[/color] Gui Drag Without pause the script [color=#FF0000;]|[/color] _WinAttach()! [color=#FF0000;]|[/color] Turn Off/On Monitor [color=#FF0000;]|[/color] ComboBox Handler Example [color=#FF0000;]|[/color] Mod. for "Thinking Box" [color=#FF0000;]|[/color] Cool "About" Box [color=#FF0000;]|[/color] TasksBar Imitation Demo

 

[color=#808080;]Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: [color=#800080;]Rating[/color] Posted Image)[/color]

 

* === [color=#808080;]My topics[/color] === *

==================================================

Posted Image

==================================================

[color=#4B0082;]AutoIt is simple, subtle, elegant.[/color] [color=#808080;]© AutoIt Team[/color]


#3 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 16,581 posts

Posted 04 March 2007 - 03:06 PM

Search the term UUID

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#4 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 04 March 2007 - 04:38 PM

Thank you! I made it. :whistle:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users