# How to execute any script from gradle plugin

**URL:** <https://discuss.gradle.org/t/how-to-execute-any-script-from-gradle-plugin/31792>\
**Category:** Plugin Portal\
**Tags:** plugins\
**Created:** [May 16, 2019, 1:10pm UTC](https://discuss.gradle.org/t/how-to-execute-any-script-from-gradle-plugin/31792 "2019-05-16T13:10:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simple-value-dev](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@simple-value-dev](https://discuss.gradle.org/u/simple-value-dev)\
**Post date:** [May 16, 2019, 1:10pm UTC](https://discuss.gradle.org/t/how-to-execute-any-script-from-gradle-plugin/31792/1 "2019-05-16T13:10:32Z")

</div>

I am unable to figureout how the plugin class’s Task would execute any script say a python script from the plugins resource folder not the projects folder.  
Heres sample code

```gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.Exec

class PluginX implements Plugin<Project> {
    
	void apply(Project project) {
	    project.task("executeScript", type: Exec) {
		 	workingDir './'
			commandLine 'python', 'xyz.py'
		};                                                    
    }
}  

```

i guess its related to working dir of exec task which i am not getting. please help.
