RunTask.SetCurrentDirectoryPath
-------------------------------

Sets the current directory for the receiver.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [RunTask](component_RunTask.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes, on macOS and Windows | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md). Use [Shell](component_Shell.md) functions instead.

MBS( "RunTask.SetCurrentDirectoryPath"; Path ) 

**MBS**( **"RunTask.SetCurrentDirectoryPath";** /\* Sets the current directory for the receiver. \*/  
**$Path**) /\* The new path for current working directory.e.g. "/Users/cs/Desktop" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The new path for current working directory. | "/Users/cs/Desktop" |

### Result

Returns OK or error.

### Description

Sets the current directory for the receiver.  
If this method isn't used, the current directory is inherited from the process that created the receiver.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### See also

- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [RunTask.GetCurrentDirectoryPath](RunTaskGetCurrentDirectoryPath.md)

### Example Databases

- [Shell/RunTask/Run Shell Script on Mac](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Shell/RunTask/Run%20Shell%20Script%20on%20Mac.shtml#1ScriptAnchor_)
- [Shell/RunTask/RunTask Windows](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Shell/RunTask/RunTask%20Windows.shtml#1ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 13th June 2020

  
[RunTask.SetArguments](RunTaskSetArguments.md) - [RunTask.SetLaunchPath](RunTaskSetLaunchPath.md)

[HTML Version](RunTaskSetCurrentDirectoryPath.shtml)