If you want to use MySQL command-line tools you should read and understand these
http://dev.mysql.com/doc/mysql/en/mysql.html
http://dev.mysql.com/doc/mysql/en/server-options.html
http://dev.mysql.com/doc/mysql/en/mysqladmin.html
If you just doubleclik the mysqld.exe file or if you try to run “mysqld” from a DOS command prompt … then it just shows up for a second and goes away! From a DOS-promt first navigate to the mysqlbin directory and then enter the appropiate command (mysql, mysqld or mysqladmin) with the correct parameteres.
But what is the “code” you want to write ?
Can't you do that from the SQL-pane in Sqlyog ?