# Shell isnt working on cmd

**URL:** <https://discourse.cakephp.org/t/shell-isnt-working-on-cmd/8114>\
**Category:** Need Help\
**Created:** [July 23, 2020, 5:07pm UTC](https://discourse.cakephp.org/t/shell-isnt-working-on-cmd/8114 "2020-07-23T17:07:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://discourse.cakephp.org/u/Julian)\
**Post date:** [July 23, 2020, 5:07pm UTC](https://discourse.cakephp.org/t/shell-isnt-working-on-cmd/8114/1 "2020-07-23T17:07:01Z")

</div>

Hello Im trying to use a shell in cakephp 2.25, but when I execute that shell using exec\_shell method (passing the correct path) it doesnt work, i have tried to use the shell in cmd (windows comand prompt) but it throws an error related with the database (error 42000), but if I execute that shell from mingw64 (it is a terminal installed when i setted up git on my pc) it works without problems, I have not already found something to solve it.

Im calling the shell like this `D:my_path/app>Console\cake ShellClass MyShell firstArg`  
and im having this error:  
`Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 #0 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Datasource\DboSource.php(459): PDOStatement->execute(Array) #1 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Datasource\Database\Mysql.php(183): DboSource->_execute('SHOW TABLES FRO...') #2 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1101): Mysql->listSources() #3 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(3214): Model->setSource('jkrg_registers') #4 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1305): Model->getDataSource() #5 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1391): Model->schema() #6 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(2646): Model->hasField('deleted') #7 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Model\Model.php(1519): Model->find('first', Array) #8 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Model\JkrgRegister.php(232): Model->read(NULL, '5f18ae7c-4e54-4...') #9 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Console\Command\JkondorShell.php(643): JkrgRegister->sendClosedRegister('5f18ae7c-4e54-4...') #10 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\Shell.php(392): JkondorShell->sendClosedRegister() #11 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\ShellDispatcher.php(201): Shell->runCommand('sendClosedRegis...', Array) #12 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\lib\Cake\Console\ShellDispatcher.php(69): ShellDispatcher->dispatch() #13 D:\xampp\htdocs\jkondor\condorsuite\custom\jk\jkondor\app\Console\cake.php(33): ShellDispatcher::run(Array) #14 {main} 42000`  
Thanks for reading.

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [July 23, 2020, 7:49pm UTC](https://discourse.cakephp.org/t/shell-isnt-working-on-cmd/8114/2 "2020-07-23T19:49:09Z")

</div>

More details about how you’re calling this, and what error you’re seeing, would be helpful.

---

<div class="post-metadata">

**Author:** ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://discourse.cakephp.org/u/Julian)\
**Post date:** [July 23, 2020, 9:40pm UTC](https://discourse.cakephp.org/t/shell-isnt-working-on-cmd/8114/3 "2020-07-23T21:40:45Z")

</div>

Okay, i have already put the info.
