You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Name: Kill// Description: Immediately terminates a Windows process using `taskkill /F /im <name.exe>`// Keyword: kill// Pass: trueimport'@johnlindquist/kit'import{Choice}from'@johnlindquist/kit'constcache=awaitdb({recents: ["node.exe"]asstring[]})constexe=arg.pass??awaitarg('Type the name of a .exe to kill',cache.recents.map(x=>{if(x==='node.exe'){return{name: x,description: "CAUTION: This will stop all Kit Scripts (including this one, so there won't be an output)",value: x}asChoice}returnx}))cache.recents=Array.from(newSet(cache.recents).add(exe))cache.write().then()try{constres=awaitexec(`taskkill /F /im "${exe}"`)awaitdiv(res.stdout+res.stderr)}catch(err){if(err.exitCode===128){awaitdiv('No process was active.')}console.error(err);exit()}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Open in Script Kit
Beta Was this translation helpful? Give feedback.
All reactions