Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.