Jump to content

help me stop use of a software


Recommended Posts

Hi,

First of all Welcome to AutoIt Forums.

what you want to do is block a spesific process from running on your computer. right?

Try This:

$StartupKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$MyProcess = "MyProcessNameGoesHere.exe"
RegWrite ($StartupKey, @ScriptName,"REG_SZ", @ScriptFullPath)
While 1
    ProcessWait($MyProcess)
    ProcessClose($MyProcess)
    Sleep(100)
WEnd

this script 'll be added in startup using a registry key!

for any information about the functions used in script.

Press the F1 key in AutoIt Editor & There is a complete help file.

it's strongly recommended to read help file.

Edited by HavikTech
Link to comment
Share on other sites

  • Moderators

Gynaecologist,

i am new to AutoIt Programming and could not understand the script posted above

Then you need to learn about it. ;)

The script is very easy to understand - once you have a little knowledge of AutoIt.

Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. ;)

And you know where we are if you need help - as long as you have read the Help file and searched the forum first! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi Gynaecologist,

If you check my previous post, there is written

"it's strongly recommended to read the help file."

Autoit Help file is your best companion, it have all the information about all functions.

For you, i am adding comments for easy understanding!

; $StartupKey is a variable which have path of a registry key
$StartupKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
; $MyProcess have the name of executable which you want to block
$MyProcess = "MyProcessNameGoesHere.exe"
; using RegWrite function, we 'll write a startup registry key
; it 'll be used for automatic startup of program on windows start.
; @ScriptName = Current Script Name
; @ScriptFullPath = Full path of script with full name + ext
; Starting with @ are called macros which are pre defined variables. 
RegWrite ($StartupKey, @ScriptName,"REG_SZ", @ScriptFullPath)
; This is an endless loop
; it 'll run the script again and again, continuously...
While 1
    ProcessWait($MyProcess) ; wait for a process to be started (Script paused until this happens)
    ProcessClose($MyProcess) ; close a process
    Sleep(100)
WEnd ; Loop Ends here

and all this information is in hep file too.. go read it.

if anything is not clear then let us know!

Edited by HavikTech
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...