---
title: "launchedProcess(launchPath:arguments:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/process/launchedprocess(launchpath:arguments:)"
---

# launchedProcess(launchPath:arguments:)

Creates and launches a task with a specified executable and arguments.

## Declaration

```swift
class func launchedProcess(launchPath path: String, arguments: [String]) -> Process
```

## Parameters

- `path`: The path to the executable.
- `arguments`: An array of NSString objects that supplies the arguments to the task. If arguments is nil, an NSInvalidArgumentException is raised.

## Return Value

Return Value An initialized NSTask object with the supplied arguments.

## Discussion

Discussion The task inherits its environment from the process that invokes this method. The NSTask object converts both path and the strings in arguments to appropriate C-style strings (using fileSystemRepresentation) before passing them to the task via argv[]) . The strings in arguments don’t undergo shell expansion, so you don’t need to do special quoting, and shell variables, such as $PWD, aren’t resolved.

## See Also

### Related Documentation

- [init()](foundation/process/init().md)

### Deprecated

- [currentDirectoryPath](foundation/process/currentdirectorypath.md)
- [launchPath](foundation/process/launchpath.md)
- [launch()](foundation/process/launch().md)
