Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Thiago Macieira
Em qui 03 abr 2014, às 10:12:27, Oswald Buddenhagen escreveu: > the quoting mechanism is inspired by how *some* windows applications > interpret quoting. but it is generally speaking just stupid. > when i finally get to it, i want to deprecate this custom single-string > mode in favor of accepting

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Joerg Bornemann
On 03-Apr-14 13:12, Oswald Buddenhagen wrote: >> one could use "cmd /c echo hello" at least I do so, or this somehow bad? >> > it's a double-fail, because in addition to the weird echo behavior, you > also have the even more weird cmd behavior (which can be modified > further with the /s flag). I

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Oswald Buddenhagen
On Thu, Apr 03, 2014 at 01:28:02PM +0300, Damian Ivanov wrote: > one could use "cmd /c echo hello" at least I do so, or this somehow bad? > it's a double-fail, because in addition to the weird echo behavior, you also have the even more weird cmd behavior (which can be modified further with the /s

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Joerg Bornemann
On 03-Apr-14 12:28, Damian Ivanov wrote: > one could use "cmd /c echo hello" at least I do so, or this somehow bad? You can use that if you're completely sure that echo prints its arguments verbatim. I for one wouldn't be surprised if there's some weird edge case where it transforms the passed

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Damian Ivanov
one could use "cmd /c echo hello" at least I do so, or this somehow bad? 2014-04-03 12:36 GMT+03:00 Joerg Bornemann : > On 03-Apr-14 02:34, Sze Howe Koh wrote: > >>> Nor on Windows's prompt: >>> C:\>echo """hello""" >>> """hello""" > > Checking arguments with the echo shell built-in on Windows is

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Joerg Bornemann
On 03-Apr-14 02:34, Sze Howe Koh wrote: >> Nor on Windows's prompt: >> C:\>echo """hello""" >> """hello""" Checking arguments with the echo shell built-in on Windows is not a good idea. It behaves (not even) slightly different from real executables. Create an executable that prints its argument

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Koehne Kai
> -Original Message- > [...] > it's not windows-only. > the quoting mechanism is inspired by how *some* windows applications > interpret quoting. but it is generally speaking just stupid. > when i finally get to it, i want to deprecate this custom single-string mode > in > favor of accep

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-03 Thread Oswald Buddenhagen
On Thu, Apr 03, 2014 at 08:34:20AM +0800, Sze Howe Koh wrote: > On 3 April 2014 06:23, Thiago Macieira wrote: > > Nor on Windows's prompt: > > C:\>echo """hello""" > > """hello""" > > > > That commit has been there since the Qt public history started. It's even > > documented as such (I had to loo

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-02 Thread Damian Ivanov
I'm sorry if this may not help but I wanted to share as it's somewhat related. On Windows systems one can from QProccess access any Windows cmd command. The process should be defined as "cmd /c $mycommand" /k maybe also useful. 2014-04-03 2:34 GMT+02:00 Sze Howe Koh : > On 3 April 2014 06:23, Thia

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-02 Thread Thiago Macieira
Em qui 03 abr 2014, às 08:34:20, Sze Howe Koh escreveu: > > There's a comment in qprocess.cpp that reads: > > // handle quoting. tokens can be surrounded by double quotes > > // "hello world". three consecutive double quotes represent > > // the quote character itself. > > > > I don't

Re: [Development] [Interest] Executing PowerShell command with quotes using QProcess

2014-04-02 Thread Sze Howe Koh
On 3 April 2014 06:23, Thiago Macieira wrote: > Em qua 02 abr 2014, às 12:18:59, Jason Kretzer escreveu: >> powershellHDD.start("PowerShell -Command \"&{(Get-WmiObject >> Win32_LogicalDisk -Filter \\\"DeviceID='C:'\\\").Size}\""); > >> This does not work as I expect it to. The dataHDDsize is