mysql - Execute batch file with arguments -
i'm working on project require me use window task scheduler execute mysql query, batch file content:
mysql -ufoo -pbar -d %1 < %2
when tested batch file via cmd:
task_sheduler.bat dbname pathtosqlfile
i get:
mysql -ufoo -pbar -d dbname 0<pathtosqlfile
i want its working, question extra space , 0, did came from?
- the space between dbname , 0
- i'm using windows 7 ultimate service pack 1 (x64)
i assume batch file not have @echo off
command, refer the echo of commands appear in screen when batch file executed. display of these commands include additional characters cmd.exe inserts display executed commands.
in case of redirections, <input
short form of stdin redirection, , number of stdin zero, real redirection 0<input
. same happens >output
, echoed 1>output
. cmd.exe remove multiple spaces original code , insert needed ones in order show executed commands.
if want not see these command expantions, insert @echo off
command @ beginning of batch file.
Comments
Post a Comment