Files
bitburner-src/markdown/bitburner.ns.kill_1.md
Michael Ficocelli 6073964768 DARKNET: Darkweb Expansion Project & Bitnode (#2139)
This is BN15. It is a really big change; see the PR for all the details.
2026-02-03 03:40:36 -08:00

109 lines
1.6 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [kill](./bitburner.ns.kill_1.md)
## NS.kill() method
Terminate the script(s) with the provided filename, host, and script arguments.
**Signature:**
```typescript
kill(filename: string, host?: string, ...args: ScriptArg[]): boolean;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
filename
</td><td>
string
</td><td>
Filename of the script to kill.
</td></tr>
<tr><td>
host
</td><td>
string
</td><td>
_(Optional)_ Hostname/IP where the script to kill is running. Defaults to the current server.
</td></tr>
<tr><td>
args
</td><td>
[ScriptArg](./bitburner.scriptarg.md)<!-- -->\[\]
</td><td>
Arguments of the script to kill.
</td></tr>
</tbody></table>
**Returns:**
boolean
True if the scripts were successfully killed, and false otherwise.
## Remarks
RAM cost: 0.5 GB
Kills the script(s) with the provided filename, running on the specified host with the specified args. To instead kill a script using its PID, see [the other ns.kill entry](./bitburner.ns.kill.md)<!-- -->.
## Example
```js
// kill the script "foo.js" on the same server the current script is running from, with no arguments
ns.kill("foo.js");
// kill the script "foo.js" on the "n00dles" server with no arguments.
ns.kill("foo.js", "n00dles");
// kill the script foo.js on the current server that was run with the arguments [1, “foodnstuff”, false]:
ns.kill("foo.js", ns.getHostname(), 1, "foodnstuff", false);
```