Page 1 of 1 1
Topic Options
#14554 - 2001-11-23 07:48 PM Nested quotations
Anonymous
Unregistered


I need some help here.

I am excuting this line and need to know how to make the interpreter see all the quotation for the line to run. I've tried setting it up as variables and using different type of quotation (') and (") but it won't see the third set of marks. Can anyone help?

Shell '%comspec% /c c:\ieupdate\su.exe administrator "Copy 'm:\apps\dss\decision support system.dot' 'd:\program files\microsoft office\templates' /Y" @WKSTA'

------------------------------------------

Top
#14555 - 2001-11-23 07:56 PM Re: Nested quotations
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Does this work?:

$command='Copy "m:\apps\dss\decision support system.dot" "d:\program files\microsoft office\templates" /y'

Shell '%comspec% /c c:\ieupdate\su.exe administrator $command @WKSTA'

_________________________
The Code is out there

Top
#14556 - 2001-11-23 08:01 PM Re: Nested quotations
Anonymous
Unregistered


No,

I'm afraid not it still treats the whole things as one and the variable is read as part of the whole string.

Thanks

Howard

Top
#14557 - 2001-11-23 08:10 PM Re: Nested quotations
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Do you know how the working line should look, and if you do can you post it?
_________________________
The Code is out there

Top
#14558 - 2001-11-23 08:18 PM Re: Nested quotations
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Tossing out half-baked ideas here...

Can you build a command string and then Execute() it?
Or, build a command (batch) file to %temp% and call it?

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#14559 - 2001-11-23 08:35 PM Re: Nested quotations
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What if you tried Roger's example, but double quotes the $command variable:

Shell '%comspec% /c c:\ieupdate\su.exe administrator "$command" @WKSTA'

-Shawn

Top
#14560 - 2001-11-23 09:06 PM Re: Nested quotations
Anonymous
Unregistered


Wild! I just had this problem yesterday. Here is what I used to get around it: the insertion of an ansi character reference. for example:

shell "xxcopy " + chr(34) + "C:\My Documents\*.doc" + chr(34)

comes out like this

xxcopy "My Documents\*.doc"

The key is inserting the chr(34) which stands for the quotations.

Top
#14561 - 2001-11-27 12:17 AM Re: Nested quotations
Anonymous
Unregistered


I have tried all those methods with no joy. It seems that it is impossible to have 3 sets of nested quotation marks within a string. I.e. IF the whole string contains more than a nest of two quotations it fails.... Any other ideas?
Top
#14562 - 2001-11-27 12:48 AM Re: Nested quotations
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Howard,

never say never , how about htis variation :

code:

shell '%comspec% /c c:\ieupdate\su.exe administrator "Copy ' + chr(39) + 'm:\apps\dss\decision support system.dot' + chr(39) + ' ' + chr(39) + 'd:\program files\microsoft office\templates' + chr(39) + ' /Y" ' + @wksta

J.

_________________________



Top
#14563 - 2001-11-26 01:36 PM Re: Nested quotations
Anonymous
Unregistered


That almost worked!

However the copy command will not use '' to enclose the path..... If I can find a copy command that will use '' instead of "" I have properly sorted it out..........

If you reverse it back to "" for the sake of the copy command it does not work!!!

Top
#14564 - 2001-11-26 01:41 PM Re: Nested quotations
Anonymous
Unregistered


sorry that last post did not come out correctly......... I meant you cannot use single quotation marks to enclose the paramters in the copy command.

Howard

Top
#14565 - 2001-11-26 02:55 PM Re: Nested quotations
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
I see ...

You have to wrap the entire copy command in Double Quotes + the source and dest. paths also in double quotes ...
right ?

dunno if this will work , but try :

code:

shell '%comspec% /c c:\ieupdate\su.exe administrator "Copy "m:\apps\dss\decision support system.dot" "d:\program files\microsoft office\templates" /Y" ' + @wksta

hmmm ... this will maybe fail on the shell 'layer' because of the doubled double quotes


J.

[ 26 November 2001: Message edited by: jpols ]

_________________________



Top
#14566 - 2002-11-23 02:53 PM Re: Nested quotations
DrUltima Offline
Fresh Scripter

Registered: 2002-08-16
Posts: 21
Loc: Nashville, TN, USA
I had a very similar problem, and I found that Kellar's fix worked, but I had to get rid of the extra spaces before and after hte plus mark (+). That in mind, I think the line you want should look something like this:

code:
Shell "%comspec% /c c:\ieupdate\su.exe administrator Copy "+chr(34)+"m:\apps\dss\decision support system.dot d:\program files\microsoft office\templates /Y"+chr(34)+" @WKSTA"

What do you think?

Top
#14567 - 2002-11-23 03:48 PM Re: Nested quotations
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I think it is convoluted and hard to troubleshoot. I have an FAQ Topic: Proper use of quotes that suggests one assemble the shell command as a string. This way the string may be printed to the console so WYSIWYG. You may want to turn on WrapAtEOL to properly display a long line.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#14568 - 2002-11-23 03:54 PM Re: Nested quotations
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
And I think this topic is a whole YEAR old [Big Grin]

Plus the spaces aren't the culprit as this is free format [Razz]

no difference in

'+$whatever+'

and

' + $whatever + '

or even

' +
$whatever
+ '
_________________________



Top
#14569 - 2002-11-23 03:59 PM Re: Nested quotations
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I realize that DrUltima dug up this year old corpse but since he is a doctor, figured it was maybe an autopsy.

I simply resonded to his question "What do you think?".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#14570 - 2002-11-23 04:00 PM Re: Nested quotations
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
me too ... or not ?
_________________________



Top
#14571 - 2002-11-25 08:12 PM Re: Nested quotations
DrUltima Offline
Fresh Scripter

Registered: 2002-08-16
Posts: 21
Loc: Nashville, TN, USA
Not actually a doctor, but I support a bunch of them. [Smile] Screen name is mostly tongue in cheek. I know it was old, I was just looking for advise on one of many solutions. I am just learning the Kix language. I am sorry if I sound like a dolt. I will try not to do any more autopsies. [Smile]
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1045 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.067 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org