Reputation: 69
I want to copy a file in C:\file.txt to a netword drive which unc path is \fic-bleu\MPM-DICIR\SERVICE-TUNNELS\
I see in Google i have to use pushd and popd but it only modify the current prompt. And i can't use the mysqldump command from this new prompt.
I tried :
cd C:\xampp\mysql\bin
pushd \\ficbleu\MPM-DICIR\SERVICE-TUNNELS
mysqldump.exe --opt --user=root --host=localhost service_tunnels > service_tunnels.sql
popd \\ficbleu\MPM-DICIR\SERVICE-TUNNELS
And
cd C:\xampp\mysql\bin
mysqldump.exe --opt --user=root --host=localhost service_tunnels > pushd \\ficbleu\MPM-DICIR\SERVICE-TUNNELS\service_tunnels.sql
Maybe i have first to save in my computer the dumpsql file and then copy bu i can't find a way to do that :(
Finally i established this script :
@echo off
cd C:\xampp\mysql\bin
mysqldump.exe --opt --user=root --host=localhost service_tunnels > service_tunnels.sql
C:\Windows\System32\xcopy "C:\xampp\mysql\bin\service_tunnels.sql" "\\ficbleu\MPM-DICIR\SERVICE-TUNNELS\01. MAIN COURANTE - MAINTENANCE\Saves\service_tunnels.sql"
Pause
But they said that there are too many arguments so i found a solution in google that says to add quotes to drive path and now its says that is invalid drive path...
Upvotes: 0
Views: 193
Reputation: 69
Correct answer, need to map network drive as a letter (Y:\ for me)
@echo off
cd C:\xampp\mysql\bin
mysqldump.exe --opt --user=root --host=localhost service_tunnels > service_tunnels.sql
C:\Windows\System32\robocopy "C:\xampp\mysql\bin" "Y:\01. MAIN COURANTE - MAINTENANCE\Saves" *.sql
Pause
Upvotes: 0