Can autohotkeys cause high disk usage

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shekhar Singh
Posts: 121
Joined: 06 Dec 2022, 02:35

Can autohotkeys cause high disk usage

11 Jan 2023, 11:40

I have been recently facing high disk usage .
I use a script which goes to 255 lines and have lot of hotkeys , hotstrings attached,
I wonder if so many functions are used in single script does that lead to high disk usage.
Should the script length be kept in check provided i have regular home use pc.
User avatar
mikeyww
Posts: 27271
Joined: 09 Sep 2014, 18:38

Re: Can autohotkeys cause high disk usage

11 Jan 2023, 12:07

No. You can see the CPU load by process in Windows Task Manager. You can show that the load is very small, and also that when you shorten or lengthen your script, it remains very small.

One can quickly write a specific script that can consume much of the CPU's time. That depends on the script.

Your number of lines in itself is tiny.
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: Can autohotkeys cause high disk usage

11 Jan 2023, 13:17

If you have loops running and you added things like setbatchlines, -1 to your script, it can cause a big cpu spike

edit after seeing @swagfag 's post I realized this is not about cpu
Last edited by AHKStudent on 16 Jan 2023, 06:17, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Can autohotkeys cause high disk usage

11 Jan 2023, 21:09

i dont understand why ppls is talking about CPU, when the thread is about disk usage, but anyway
u can download process hacker(or whatever theyre calling it these days), turn on all IO and disk-related columns, and observe what the script is doing. but as mikeyww says, it can depend on the script. if ure copying/moving/reading/writing large files or doing that frequently for small files, u can bet ur ass the disk usage is going to be high. thats to be expected
in any case, u may have other programs running causing the high disk usage, eg crappy antivirus whose heuristics ur ahk script trips(for whatever reasons), so it goes to "check" on the "virus"
User avatar
mikeyww
Posts: 27271
Joined: 09 Sep 2014, 18:38

Re: Can autohotkeys cause high disk usage

11 Jan 2023, 21:20

Sorry about that; I was wrongly thinking of CPU instead of disk, but I agree with the comments here!
Mannaia666
Posts: 26
Joined: 17 Feb 2022, 03:37

Re: Can autohotkeys cause high disk usage

12 Jan 2023, 08:14

Yes, it's possible to archive a high disk usage with a script, but that depend on what your script do, far more than how many line of code there is.
if you want (and if you can) put your script here so we can look for something that can cause the problem you are talking.
let us know!
Shekhar Singh
Posts: 121
Joined: 06 Dec 2022, 02:35

Re: Can autohotkeys cause high disk usage

13 Jan 2023, 13:49

thanks @Mannaia666
i will do that .
Shekhar Singh
Posts: 121
Joined: 06 Dec 2022, 02:35

Re: Can autohotkeys cause high disk usage

16 Jan 2023, 01:38

Here,

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


return
#t::Run,"https://web.whatsapp.com/"
return
Numpad1::#v
return
+q::Send,v
+w::Send,b
Numpad2::^v
#s::Run,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey\Window Spy.lnk"
RButton::x
LButton::z
v::LButton
return
b::RButton
return
MButton::Click, 847 197
return
;LButton 

NumpadSub::
Run,"https://www.google.com"
Sleep 2000
Send {F6}
return
NumpadMult::Run,"https://www.amazon.in"
return

NumpadEnter::Click, 125 16
return

Numpad0::
Send {Enter}
FormatTime, xx, [, hh:mm:ss tt : 
SendInput, %xx%
return

#m::LButton

;+g::Send, google.com
#w::
Run,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Word.lnk"
return

;#n::
;Run,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\OneNote.lnk"
;return
#c::Run,https://study.cfainstitute.org/app/cfa-program-level-ii-for-may-2023#quizzes
return

;::q::Question
;::c::current tax
#q::
Send, ^s
Send, ^w
Run, "C:\Users\deepa\Desktop\New AutoHotkey Script.ahk"
;Send, {^+}
return

#i::Run,"C:\Users\deepa\Desktop\imagei.jpg"
return

Wheelup::d
Wheeldown::s

#e::Run,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Excel.lnk"
return

;#h

;Numpad5::Run,"C:\Users\deepa\Desktop\hhhh.txt"
;return


;Numpad4::Run,"chrome-;extension://offfjidagceabmodhpcngp;emnnlojnhn/options/options.html"

;Numpad3::
;Send, in 30 words
;Send {Enter}
;return

Numpad3::Send,#h
return

Numpad6::
Send ^s
;Sleep 100
;Send ^w
return

#a::
Run,"https://www.autohotkey.com/boards/posting.php?mode=post&f=76"
Run,"https://www.autohotkey.com/boards/search.php?search_id=egosearch"
return

Numpad7::
Click, 1718 248 
return

Numpad9::
Click, 1799 250 
return

;Numpad9::Run,"C:\Users\deepa\Desktop\imagei.jpg"
;return

Numpad8::
Click, 1759 235 
return

;end to ctr end
;toggle
;mouse
;pause

#y::
Run,"https://www.autohotkey.com/boards/search.php?search_id=egosearch"
return

;#x::
;WinMinimize,("hhhh - Notepad")
;return

CoordMode, Mouse
#^p::Click, 300 300
return

Numpad5::
;Send {Esc]
;Sleep 200
Click, 719 752
return

#2::
Send,1.2.3.4.5.6.7.
return

#o::
Run,"C:\Program Files\AutoHotkey\WindowSpy.ahk"
return

#m::
;WinMinimizeAll
Sleep 1000
Click, 1842 36 Right ; (right clicking ahk file)
Sleep 1000
Click, 1524 157 0 ; (click open with)
Sleep 200

;#n::
;Click, 1422 147 ; (click notepad)
;Sleep 1000
;Click, 1325 132
;Return

;8::
;Send {Enter}********
;Send {Enter}
;return

#u::
Run, "https://chat.openai.com/chat/14152388-cddd-42bf-8d75-889f88eddb13"
return

End::
^End
return

RAlt::
Send, #h
Sleep 4000
Send, {Esc}
return

;ralt is the key 
;broad funct = websites .= programs = remapings = clicking = text """ mouse first , than keys , 

#7::
loop, 7
{
Click, 1759 235
Sleep 2000
}
return

;=::
;Send, {+ 6}
;Sleep 100
;Send {Enter}
;return

;COMMENTS
=::
Send, ^{f2}
Sleep 100 
Send {Down}
return

#6::
Run,"https://www.autohotkey.com/docs/v1/misc/WinTitle.htm#ahk_class"
return

;numpad3::
;Send, #h
;return

#f::
run, "https://community.notepad-plus-plus.org/topic/23952/mark-a-line-using-a-single-button-with-macro-or-any-feature"
return

\::Send, {Esc}
return

;Numpad4::Click, 1706 237
;return

Numpad4::
Click, 1219 139
Sleep 100
Click, -777 330
return

;MButton::
;Click, 1219 139
;Sleep 200
;Click, -777 330
;return

#x::
Click, 1219 139
return

#5::Edit
;Winactive
return

;#1::Send,v 
;#2::Send,b
;#3::Send,V
;#4::Send,B
Mannaia666
Posts: 26
Joined: 17 Feb 2022, 03:37

Re: Can autohotkeys cause high disk usage

16 Jan 2023, 03:08

There seems to be nothing that can cause a high disk usage in this script, unless you keep spamming the hotkey calling excell and opening sites, but that will use the disk just until the software is run, then it should stop using it.
if you see a high disk usage even when all is still, maybe you can have a hardware disk problem.
Shekhar Singh
Posts: 121
Joined: 06 Dec 2022, 02:35

Re: Can autohotkeys cause high disk usage

16 Jan 2023, 04:09

and how much time should i let it run in background .
Mannaia666
Posts: 26
Joined: 17 Feb 2022, 03:37

Re: Can autohotkeys cause high disk usage

16 Jan 2023, 04:10

as long as you don't call any hotkey the disk use caused by the script should be 0%
Shekhar Singh
Posts: 121
Joined: 06 Dec 2022, 02:35

Re: Can autohotkeys cause high disk usage

16 Jan 2023, 05:06

dont call means, here.. i wasnt referring any disk usage issues.. i was generally asking because sometimes i let script run for hours as its not cause any issue .is that ok.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AdsBot [Google], Bing [Bot], Google [Bot] and 95 guests