Wingens Posted May 20, 2016 Posted May 20, 2016 Hi i need help with running a command using autoit. Below you see the script i use only wich gives me an error. RunWait(@ComSpec & " /c " & 'c:\bfretail\mysql\bin\mysql.exe -u"root" -p"*******" -h"localhost" -e"select MD_NM_MODULE from module where MD_AANGESCHAFT = 'J';" -Dbnfdta > C:\Temp\module.txt', "", @SW_HIDE) The error is found in this part of the script: MD_AANGESCHAFT = 'J';" The the dos command uses a ' around the letter J when i use autoit this gives an error when run script. Hope you guys can help me.
rudi Posted May 20, 2016 Posted May 20, 2016 (edited) Hi. To track down "quotation" issues, it's always a good idea, to separately "build" the Command Line, then to use "run()" $cmd=@ComSpec & ' /c "' & 'c:\bfretail\mysql\bin\mysql.exe -u"root" -p"*******" -h"localhost" -e"select MD_NM_MODULE from module where MD_AANGESCHAFT = ''J'';" -Dbnfdta > C:\Temp\module.txt' ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $cmd = ' & $cmd & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console regards, Rudi. Edited May 20, 2016 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now