naru Posted March 11, 2019 Posted March 11, 2019 (edited) I want to run this code on only my computer, if anyone copy this script file and trying to run it on his computer then don't run. #include <IE.au3> Local $oIE = _IEAttach ("Home") $Dprintdetails1 = _IEGetObjById($oIE, "printdetails") ; get first object $Dprintdetails1.id = "printdetails1" ; change it's id $Dprintdetails = _IEGetObjById($oIE, "printdetails") ; get second object $Dprintdetails.RemoveNode(True) ; remove it exit its possible ? Edited March 12, 2019 by naru
Nine Posted March 11, 2019 Posted March 11, 2019 Yes you can verify a few things like @computername and other stuffs, if you create (of course) an .exe “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
caramen Posted March 11, 2019 Posted March 11, 2019 (edited) Yes it is possible from multiple ways. You can implemente a password inside your script and ask the password when running the script. Something like $Key = "123456" $Password = GuiCtrlCreateInput (..... GUICtrlRead ($Password) If $Password = $Key Then ....MyStuff EndIf You can also restrict computer privilege and put at the top of your script #requireAdmin if you got the control of the computer. Edit: you need to explain the context a bit more. Will be on one computer with multiple users ? Will be on multiple computer with one user ? ... Edited March 11, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
naru Posted March 12, 2019 Author Posted March 12, 2019 @Nine Computer name can change. Is there any other tool for Verify that can not be changed ? @caramen I can't enter password everytime for running script.
Nine Posted March 12, 2019 Posted March 12, 2019 Using WMI you could read the processor id, or the OS serial number, or any other device id you got... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
caramen Posted March 12, 2019 Posted March 12, 2019 (edited) So you're not clear enouth, I am sorry. 22 hours ago, naru said: I want to run this code on only my computer, 20 minutes ago, naru said: Computer name can change. What the ... ? Your computer name can change one time two time maybe but always changing ? Nop. Get a good statement. And then we will be able to help you, explain everything in one time. Edited March 12, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
naru Posted March 12, 2019 Author Posted March 12, 2019 11 minutes ago, caramen said: So you're not clear enouth, I am sorry. What the ... ? Your computer name can change one time two time maybe but always changing ? Nop. Get a good statement. And then we will be able to help you, explain everything in one time. @caramen, This script should run in my computer only, If someone tries to copy it and try to run it in his computer, It should be not run in his computer. (The computer name is not mine, but if someone can copy this file, He was also able to read my computer name and set as same.) *I hope you will understand my bad english
caramen Posted March 12, 2019 Posted March 12, 2019 (edited) Now it's better yeah. So we have to find what wont change. Or make somthing that will be missing from other computer. I got a solution for you. If you know how to manipulate the registry. You can simply make a key on your computer manually. You can do it yourself with: W + R Then CMD Then Regedit Or with AutoIT With RegWrite And then check with your script if the key exists. If it does not exists then your script exit. And you wont need to enter a password. And also if you are alone to know where the script is checking this is pretty safe for you. This is the logic help. If you need help with some code post the code of what you tryed first. Edited March 12, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
naru Posted March 12, 2019 Author Posted March 12, 2019 @caramen, How to do it ? I don't know about its, i think one another way is verify the serial number of computer then run the code, can you tell me how to check computer serial number using autoit?
caramen Posted March 12, 2019 Posted March 12, 2019 It is also in the registry so you 're lucky. Let me prepare a code to learn you the registry basics. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
caramen Posted March 12, 2019 Posted March 12, 2019 If i remember @Subz but i am not sure made this little code for me some time ago. ConsoleWrite(_RegKeyExists("HKCU\Control Panel\Accessibility\Off") & @CRLF) ConsoleWrite(_RegKeyExists("HKCU\Control Panel\Accessibility\On") & @CRLF) ConsoleWrite(_RegKeyExists("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Au3Info.exe") & @CRLF) Func _RegKeyExists($_sRegKey) Local $sDefault = RegRead($_sRegKey, "") ;~ Try to read default value Switch @error Case 1, 2 ;~ Unable to open requested key | Unable to open requested main key Return SetError(@error, 0, 'Error: Registry Key: "' & $_sRegKey & '" does not exist.') Case Else ; Registry Key Exists | Return (Default) value Return SetError(0, 0, $sDefault) EndSwitch EndFunc Now look how to work with this already made code and your goal. Let's see my next answer. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
FrancescoDiMuro Posted March 12, 2019 Posted March 12, 2019 13 minutes ago, naru said: If someone tries to copy it and try to run it in his computer, It should be not run in his computer. If @ComputerName = "NameOfYourComputer" Then ; Execute script Else Exit EndIf Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
caramen Posted March 12, 2019 Posted March 12, 2019 3 minutes ago, FrancescoDiMuro said: If @ComputerName = "NameOfYourComputer" Then ; Execute script Else Exit EndIf He dont want to do it with computer name 😕 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
caramen Posted March 12, 2019 Posted March 12, 2019 (edited) Ok mate, @naru I made 3 little script for you but i wont make your script for you. I say you that. If you understand everything inside this : You can do what you want to do : First script : (Making custom Registry Key : ) Each computer that will run this script WILL be able to execute your script. RegWrite ("HKCU\Software\MyScript" , "ScriptWontWorkWithoutThisKEy", "REG_SZ" , "1234" ) If @error Then MsgBox (0 , "Not Copied" , @Error ) Second script : (Deleting custom key) Each computer that will run this script WONT be able to execute your script. RegDelete ("HKCU\Software\MyScript" , "ScriptWontWorkWithoutThisKEy" ) If @error Then MsgBox (0 , "Registry SubKey is NOT Deleted" , @Error ) RegDelete ("HKCU\Software\MyScript" ) If @error Then MsgBox (0 , "Registry Key is NOT Deleted" , @Error ) Third script : (You verify the presence of the registry key and you act depend of the check result : $DoesMyKeyExists = _RegKeyExists( "HKCU\Software\MyScript" ) If $DoesMyKeyExists = "" Then $DoesMyKeyExists = "My Key exists" ; if $DoesMyKeyExists = "" That mean the key is here and exists so i change $DoesMyKeyExists value to make it human readable. Else $DoesMyKeyExists = "My Key does NOT exists" EndIf MsgBox (0 , "Key ?" , $DoesMyKeyExists ) If $DoesMyKeyExists = "My Key exists" Then ;If $DoesMyKeyExists = "My Key exists" Then key exists MsgBox (0 , "Key is here" , "My script will now continu" ) ;~ ...Here is your script if the regkey is detected Else MsgBox (0 , "Key is not here" , "My script will now Stop and Exit" ) ;~ ...The Script Stop if the key isn't detected Exit EndIf Func _RegKeyExists($_sRegKey) Local $sDefault = RegRead($_sRegKey, "") ;~ Try to read default value Switch @error Case 1, 2 ;~ Unable to open requested key | Unable to open requested main key Return SetError(@error, 0, 'Error: Registry Key: "' & $_sRegKey & '" does not exist.') Case Else ; Registry Key Exists | Return (Default) value Return SetError(0, 0, $sDefault) EndSwitch EndFunc Cannot do more than that for you... I can add there is a lot of other ways to do that. Edited March 12, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
naru Posted March 13, 2019 Author Posted March 13, 2019 @caramen Thank you But, i want to verify my computer serial number and after run script. Can you help me? How to verify serial number ?
FrancescoDiMuro Posted March 13, 2019 Posted March 13, 2019 @naru Use WMI object and query the Win32_OperatingSystem class, in which you can find the SerialNumber of your PC Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
caramen Posted March 13, 2019 Posted March 13, 2019 Or run in cmd and StandOutRead wmic bios get serialnumber ;Or wmic csproduct get identifyingnumber My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
Bert Posted March 13, 2019 Posted March 13, 2019 First - the computer you are running it on - Does the owner of this computer KNOW this script is going to run on his computer? Second - if this is a networked PC, then why not simply use group policy? Third - How would someone get access to your PC? Forth - if for a company and you are NOT the system admin or someone who is allowed to do this - Do you have permission? I'm asking all this for what you are asking for is rather odd for some of the details are missing that would make helping you much easier. The Vollatran project My blog: http://www.vollysinterestingshit.com/
naru Posted March 14, 2019 Author Posted March 14, 2019 (edited) 14 hours ago, Bert said: First - the computer you are running it on - Does the owner of this computer KNOW this script is going to run on his computer? Second - if this is a networked PC, then why not simply use group policy? Third - How would someone get access to your PC? Forth - if for a company and you are NOT the system admin or someone who is allowed to do this - Do you have permission? I'm asking all this for what you are asking for is rather odd for some of the details are missing that would make helping you much easier. My right question is I want to sell my complied autoit script, But i don't know it legal or inlegal. if selling complied script is legal i have more questions about this : 1) Is complied Script is Secure ? (Anbody can De-complie it ?) 2) How to add licence Key/Activation Key to my script ? (For Run it only 1 pc, don't run if someone get copied) 3) How do I make my script to expire ? (Run it only limited period not for lifetime, Ex. 6 months or 2 Years). Edited March 14, 2019 by naru
FrancescoDiMuro Posted March 14, 2019 Posted March 14, 2019 @naru 1) Decompiling FAQ; 2) XProTec.au3 (as always, post the script in which you try to use that USF instead of ask how to do it); 3) Limited Freeware Option Example (XProTec.au3). Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now