# Using option --init-script together with --gui?

**URL:** <https://discuss.gradle.org/t/using-option-init-script-together-with-gui/11429>\
**Category:** Help/Discuss\
**Created:** [September 1, 2015, 5:14pm UTC](https://discuss.gradle.org/t/using-option-init-script-together-with-gui/11429 "2015-09-01T17:14:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoff](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@zoff](https://discuss.gradle.org/u/zoff)\
**Post date:** [September 1, 2015, 5:14pm UTC](https://discuss.gradle.org/t/using-option-init-script-together-with-gui/11429/1 "2015-09-01T17:14:32Z")

</div>

Is it not intended to use option --init-script together with --gui? If I do so, the --init-script part is ignored in the GUI (,but works perfect in the command line).

---

<div class="post-metadata">

**Author:** ![Shinya\_Mochida](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/shinya_mochida/32/2393_2.png) [@Shinya\_Mochida](https://discuss.gradle.org/u/Shinya_Mochida)\
**Post date:** [September 2, 2015, 12:36am UTC](https://discuss.gradle.org/t/using-option-init-script-together-with-gui/11429/2 "2015-09-02T00:36:06Z")

</div>

if you run gradle with `--gui` and `--init-script` in command line, `--init-script` will be ignored.  
If you run gradle tasks with `--init-script` in GUI, it won’t be ignored.

Example:

`init-script.gradle`

```groovy
println 'init script'

```

`build.gradle`

```groovy
apply plugin: 'base'

task fooBar << {
  println 'foo-bar'
}

```

![gui](https://googledrive.com/host/0B4hhdHWLP7RRY0wzU2dXMEV5T2M)

![cui-to-gui](https://googledrive.com/host/0B4hhdHWLP7RRdTVVYk5tX2VyQjQ)

---

<div class="post-metadata">

**Author:** ![zoff](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@zoff](https://discuss.gradle.org/u/zoff)\
**Post date:** [September 2, 2015, 7:28am UTC](https://discuss.gradle.org/t/using-option-init-script-together-with-gui/11429/3 "2015-09-02T07:28:51Z")

</div>

Is there any reason for this different behavior? My use case is to start from the command line (batch file). The possibility in the GUI is not useful for my use case.

My workaround right now is to copy my init files into USERHOME/.gradle/init.d and start with option --gui.

I just don’t see any restrictions in the syntax of the gradle command, that the two options --gui and --init-script should not be used together from the command line.
