0

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?

1 Answer 1

0

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"
3
  • 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. Dec 9, 2012 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, 2012 at 18:45
  • With /C it works, than you Dec 10, 2012 at 9:13

You must log in to answer this question.

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