Executing Scripts through the Command Line

You can automate executing the scripts using the command line.

Note

To run the Command Line in Windows 10:

From the Desktop Mode

  • Move the mouse cursor to the exact lower left corner until the desktop shortcuts menu appears.
  • Right-click to see the shortcut menu and than click Run.

From the Charms Bar

  • Move your mouse to the upper right corner until the Charms Bar appears.
  • Select Apps from the list and type ‘run’ in the search box.
  • Click Run from the search results.

Use Windows + R Shortcut Keys

  • In desktop mode, press the Windows + R keys, to show the Run command line.
  • In the window that opens, type cmd and press Enter.

1. Type a path to the datagenerator.com file located in the dbForge Data Generator for MySQL installation folder on your PC, and then press the SPACE key.

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com"

2. To execute the corresponding script, use the /execute command, and press the SPACE key.

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /execute /?

3. Specify connection details of the server where to execute the script.

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datageneratorsql.com" /execute /connection:"User Id=root;Host=162.186.11.95;Database=sakila;Character Set=utf8"

4. Specify the script file.

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /execute /connection:"User Id=root;Host=162.186.11.95;Database=sakila;Character Set=utf8"  /inputfile:"script.sql"

5. Specify the password.

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /execute /connection:"User Id=root;Host=162.186.11.95;Database=sakila;Character Set=utf8"  /inputfile:"script.sql" /password:mypsw

6. To hide the command line window, use the /quiet command. (Useful for batch files).

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /execute /connection:"User Id=root;Host=162.186.11.95;Database=sakila;Character Set=utf8"  /inputfile:"script.sql /password:mypsw /quiet

7. Press ENTER to run the process. If you use the /argfile argument, all the following commands are specified inside an argfile:

 /execute
 /connection:"Data Source=DBMSSQL\MSSQL2014;Integrated Security=False;User ID=sa" 
 /inputfile:"script.sql" 

In this case, the command line string will be written as follows:

"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /argfile:myarg.txt