Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's my problem: I've made a shortcut on my Desktop (Windows XP (sigh)) like this:

C:\WINDOWS\system32\cmd.exe /k "mysql -u root drupal-defaultadm < ^"C:\Documents and Settings\AAA\Mes documents\Downloads\01.drupal-defaultadm.sql^" && exit"

When I double click on it, the DOS prompt is opened, but I get this error:

File not found.
C:\wamp\bin\mysql\mysql5.5.24\bin>

So I'm trying to do the command "by hand" and only removing the ^:

C:\wamp\bin\mysql\mysql5.5.24\bin>mysql -u root drupal-defaultadm < "C:\Documents and Settings\AAA\Mes documents\Downloads\01.drupal-defaultadm.sql"
C:\wamp\bin\mysql\mysql5.5.24\bin>

And gives no error. I'm pretty sure this has to do with the whitespaces enclosed with ".

How shall I do to make it work?

share|improve this question
up vote 0 down vote accepted

You could just have the shortcut as

C:\whatever\path\mysql -u root drupal-defaultadm < "C:\Documents and Settings\AAA\Mes documents\Downloads\01.drupal-defaultadm.sql"

and you could use cmd.exe as well like this

C:\WINDOWS\system32\cmd.exe /C C:\whatever\path\mysql -u root drupal-defaultadm < "C:\Documents and Settings\AAA\Mes documents\Downloads\01.drupal-defaultadm.sql"
share|improve this answer
    
Thank you for your answer, but if I want the window to close (= add && exit) or execute another program via && something else your solution doesn't work... And I want that windows to close as soon as it's finished. – Olivier Pons Dec 9 '12 at 7:45
    
For that use the second version with flag /C. The command prompt would close after executing the command. – amit_g Dec 9 '12 at 18:45
    
With /C it works, than you – Olivier Pons Dec 10 '12 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .