Script to close application after opening PC

Get help with using AutoHotkey and its commands and hotkeys
AmDeG 11
Posts: 358
Joined: 28 Nov 2013, 11:42

Script to close application after opening PC

11 Sep 2014, 08:22

Which would be the script to close an application that is opened through the Start up, exactly 4 minutes after the computer has been turned on? It is this a Skype window. thanks
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: Script to close application after opening PC

11 Sep 2014, 08:43

Perhaps, you can use a bat file ...

Code: Select all

REM pause for 240 seconds:
timeout /t 240
REM Kill the program:
taskkill /im ProgramName /f
Greetings!
Everything is possible!
AmDeG 11
Posts: 358
Joined: 28 Nov 2013, 11:42

Re: Script to close application after opening PC

11 Sep 2014, 08:52

but is it possible as a autorun ahk script?
ahcahc
Posts: 110
Joined: 25 Jul 2014, 23:55

Re: Script to close application after opening PC

11 Sep 2014, 09:26

Code: Select all

#Persistent
#SingleInstance Ignore
SetTimer, check_skype, 1000
return

check_skype:
Process, Exist, skype.exe
if(errorlevel!=0)
{
Process, close, skype.exe
RunWait, %comspec% /c taskkill /f /im skype.exe, , hide
ExitApp
}
elapse := A_TickCount/1000/60
if (elapse>5)  ;pc was already powered-on for at least 5 minutes
	ExitApp
return
AmDeG 11
Posts: 358
Joined: 28 Nov 2013, 11:42

Re: Script to close application after opening PC

11 Sep 2014, 14:33

thanks for the script but this scripts is killing my whole Skype and I need just to close a second Skype that I open at the Startup in order to keep my Skype online. Could you tweak that?
AmDeG 11
Posts: 358
Joined: 28 Nov 2013, 11:42

Re: Script to close application after opening PC

11 Sep 2014, 15:08

I was able to do it! Thank you
lexikos
Posts: 6879
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Script to close application after opening PC

12 Sep 2014, 01:58

Why don't you just turn off auto-start within Skype?

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot] and 294 guests