1

I am looking to have a batch file login to a database for me and the execute 4 commands.

So here is what I have so far...

@echo off 
Echo "password" | config -c && 13 && 14 && 3
pause 
exit

So what I need this to do is to automatically accept my password as the first user input, the 13 as the second, the 15 as the third, and the 3 as the forth. Any advice or input is appreciated.

2
  • Which database engine are you using? SQL Server and MySQL already have command line tools which can do just what you want. Commented Mar 5, 2015 at 18:11
  • I am entering this command into a Lawson interface Commented Mar 5, 2015 at 18:21

1 Answer 1

1

I do not know what is right syntax for your config command and whether accepts piped input or not, but

  • Echo "password" | config redirects to your config command all the string "password" including double quotes and trailing space (yes, that space before |); use Echo(password|config instead (no, echo( with opening parenthesis is not a keying mistake).
  • In the link thereinbefore, note && (doubled ampersand) meaning and check thoroughly config -c && 13 && 14 && 3 command in that point of view.
  • Read how-to escape characters (and particularly Escaping the pipeline paragraph).

HTH

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.