[go-nuts] Re: Os/Exec problematic quotation marks
Thanks to Volker and Tyler for the answers. It was very useful. El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven Rico Posada escribió: > > Hello, > > Actually i'm working in a go application that receive a http request and > start some windows assistants. (RPA's) > > The assistants are executed from windows cmd: > > "C:/path/file.exe" --args > > When i start the assistant from cmd manually, in the task Manager i see > the arguments without quotation marks. But if i open the assistant from go > application the arguments are left with quotation marks. > > > > In golang i'm using the lib *"os/exec":* > > Internet explorer is only an example. > > *Do you know what's the reason?* > > Thanks. > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Re: Os/Exec problematic quotation marks
Oh, you beat me to it :) Good luck on your project! On Wed, Sep 5, 2018 at 9:35 AM Tyler Compton wrote: > I believe what Volker is suggesting is to create your command in this way: > > cmnd := exec.Command("C:/Program Files/internet explorer/iexplore.exe", > "--nogui", "--start", "AGT_BANCL_CobrosManuales") > > Have you given this a shot? The exec.Command function expects each > space-separated argument of the command to be a separate argument. I > suspect that exec.Command is seeing spaces in the one argument you're > giving it and assuming it needs quotes. > > On Wed, Sep 5, 2018 at 9:17 AM Daniel Estiven Rico Posada < > danielrico.pos...@gmail.com> wrote: > >> Yeah, but i want that when i execute an application from Go exec, be the >> same that if i executed from cmd directly. But actually, the execution from >> go exec have quotation marks in the args. is there something possibility? >> >> >> >> El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven >> Rico Posada escribió: >>> >>> Hello, >>> >>> Actually i'm working in a go application that receive a http request and >>> start some windows assistants. (RPA's) >>> >>> The assistants are executed from windows cmd: >>> > "C:/path/file.exe" --args >>> >>> When i start the assistant from cmd manually, in the task Manager i see >>> the arguments without quotation marks. But if i open the assistant from go >>> application the arguments are left with quotation marks. >>> >>> >>> >>> In golang i'm using the lib *"os/exec":* >>> >>> Internet explorer is only an example. >>> >>> *Do you know what's the reason?* >>> >>> Thanks. >>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Re: Os/Exec problematic quotation marks
I believe what Volker is suggesting is to create your command in this way: cmnd := exec.Command("C:/Program Files/internet explorer/iexplore.exe", "--nogui", "--start", "AGT_BANCL_CobrosManuales") Have you given this a shot? The exec.Command function expects each space-separated argument of the command to be a separate argument. I suspect that exec.Command is seeing spaces in the one argument you're giving it and assuming it needs quotes. On Wed, Sep 5, 2018 at 9:17 AM Daniel Estiven Rico Posada < danielrico.pos...@gmail.com> wrote: > Yeah, but i want that when i execute an application from Go exec, be the > same that if i executed from cmd directly. But actually, the execution from > go exec have quotation marks in the args. is there something possibility? > > > > El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven > Rico Posada escribió: >> >> Hello, >> >> Actually i'm working in a go application that receive a http request and >> start some windows assistants. (RPA's) >> >> The assistants are executed from windows cmd: >> > "C:/path/file.exe" --args >> >> When i start the assistant from cmd manually, in the task Manager i see >> the arguments without quotation marks. But if i open the assistant from go >> application the arguments are left with quotation marks. >> >> >> >> In golang i'm using the lib *"os/exec":* >> >> Internet explorer is only an example. >> >> *Do you know what's the reason?* >> >> Thanks. >> >> >> -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Os/Exec problematic quotation marks
I founded the problem. When you send all the args as a string in the second parameter of exec.Command, this is left with quotation marks; but if you send each arg as a parameter independently (exec.Command(path, arg1, arg2, arg3) this is left without quotation marks. El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven Rico Posada escribió: > > Hello, > > Actually i'm working in a go application that receive a http request and > start some windows assistants. (RPA's) > > The assistants are executed from windows cmd: > > "C:/path/file.exe" --args > > When i start the assistant from cmd manually, in the task Manager i see > the arguments without quotation marks. But if i open the assistant from go > application the arguments are left with quotation marks. > > > > In golang i'm using the lib *"os/exec":* > > Internet explorer is only an example. > > *Do you know what's the reason?* > > Thanks. > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Os/Exec problematic quotation marks
Yeah, but i want that when i execute an application from Go exec, be the same that if i executed from cmd directly. But actually, the execution from go exec have quotation marks in the args. is there something possibility? El miércoles, 5 de septiembre de 2018, 3:32:44 (UTC-5), Daniel Estiven Rico Posada escribió: > > Hello, > > Actually i'm working in a go application that receive a http request and > start some windows assistants. (RPA's) > > The assistants are executed from windows cmd: > > "C:/path/file.exe" --args > > When i start the assistant from cmd manually, in the task Manager i see > the arguments without quotation marks. But if i open the assistant from go > application the arguments are left with quotation marks. > > > > In golang i'm using the lib *"os/exec":* > > Internet explorer is only an example. > > *Do you know what's the reason?* > > Thanks. > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: Os/Exec problematic quotation marks
Each argument to the command must be its own string in os.Exec. V. On Wednesday, 5 September 2018 10:32:44 UTC+2, Daniel Estiven Rico Posada wrote: > > Hello, > > Actually i'm working in a go application that receive a http request and > start some windows assistants. (RPA's) > > The assistants are executed from windows cmd: > > "C:/path/file.exe" --args > > When i start the assistant from cmd manually, in the task Manager i see > the arguments without quotation marks. But if i open the assistant from go > application the arguments are left with quotation marks. > > > > In golang i'm using the lib *"os/exec":* > > Internet explorer is only an example. > > *Do you know what's the reason?* > > Thanks. > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.