Quotation character in button parameters

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Quotation character in button parameters

Post by *HBB »

I have read this topic.

I want to put a single parameter which include quotation characters. I tried \" and %", they are not worked. Is there any way to do it? Is this a problem which is same as the above topic that I read.

Regards

EDIT >>> My question is not meaningfull unless scripts/executables do not eat quotations. I found another solution for my problem in this link.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is not a TC issue but that program's issue for which you need to write parameter line. TC simply passes parameter line as is but different programs handle quotes in different ways. It doesn't matter for TC where are parameters in your command line but it does matter for program that accepts it.

Some programs (e.g. compiled with standard Microsoft CRT) e.g. handle \" as just double quote (so stupid thing happens when you pass quoted path to folder like "C:\").
HBB
Senior Member
Senior Member
Posts: 295
Joined: 2008-05-05, 21:31 UTC

Post by *HBB »

MVV hello.

Yes, I saw it. TC passes command line as it is. But, most of the programs take out the values in quotations and then remove the quotations.

The following code seems well (a little bit dangerous for multiple executions) :

Set objSWbemServices = GetObject("WinMgmts:Root\Cimv2")
Set colProcess = objSWbemServices.ExecQuery("Select * From Win32_Process")
For Each objProcess In colProcess
If InStr (objProcess.CommandLine, ProgramPath) <> 0 Then
strLine = Trim(Mid(objProcess.CommandLine, InStr(objProcess.CommandLine , ProgramPath) + Len(ProgramPath) + 1))
End If
Next
msgbox strLine
Post Reply