|
|
|||||||
Hi. I am using Kixtart 3.4. I have thoroughly read through the informative post on the proper use of quotes. I have applied this post to good use, but I would like to use more sets of quotes in a line of code. Does the "Use Chr(34) in place of double quotes" mean use Chr(34) instead of ""? Here is the code snippet that I am trying to use with multiple quotes. I have already applied the single quote and double quote rule. code:As you can see, I already use the outer single quotes and the inner double quotes. However, I need to put an additional set around the group name I am trying to add since it has a space in it. I am not allowed to change the group name.$ADDGROUP= 'runas /u:domain\user "net localgroup administrators domain\desk techs /add" |sanur /i logon.txt' Can someone help? Please let me know if I have disobeyed any forums rules. I have read them thoroughly and hope I followed them all. Thanks! -Jeremy [ 24. September 2003, 23:22: Message edited by: jdogg ] |
||||||||
|
|
|||||||
This should work: code:$ADDGROUP= 'runas /u:domain\user "net localgroup administrators \"domain\desk techs\" /add" |sanur /i logon.txt' |
||||||||
|
|
|||||||
Looks like RUNAS processes it's own metahcars inside the cmd string, quotes specied with /", worth a try: ? 'runas /u:domain\user "net localgroup administrators \"domain\desk techs\" /add" |sanur /i logon.txt' -Shawn |
||||||||
|
|
|||||||
:errrk: |
||||||||
|
|
|||||||
Too late and spelling errors in it ? |
||||||||
|
|
|||||||
shawn, you working on a UNIX workstation - (/")? code:RUNAS [/profile] [/env] [/netonly] /user:<UserName> program [ 24. September 2003, 23:32: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
Bloody fat fingers of mine. I was rushing to beat the two of you. What a stressfull board this is. |
||||||||
|
|
|||||||
Thanks guys! Even the late ones... I am sure it will work. You guys are awesome, and freakin' quick too! I will test it tomorrow when I am back at work and will let all of you know for sure. -Jeremy |
||||||||
|
|
|||||||
It worked guys! Thanks so much! I guess the lesson learned is that on the third set of quotes (most internal), you must use \" instead of just ". Thanks again. -Jeremy |
||||||||
|
|
|||||||
quote:Not quite correct. The '\"' was a requirement of the runas program as documented above. Once you have your string defined by single quotes, you can add as many double-quotes as you like. code:$ADDGROUP= ' "net" "localgroup" "administrators" "domain\desk techs" ' |
||||||||
|
|
|||||||
i have a simular problem code:when i do this i get the following code:how can i get this to work and what am i doing wrong? (sorry to highjack the post but the questions are the same (i think) |
||||||||
|
|
|||||||
That is most likely caused by the fact that copy.exe simply does not exist Copy is a shell intrinsic command |
||||||||
|
|
|||||||
You should be starting your own thread and referencing this one. Try: code:run 'runas /env /user:sandh\$USER "%comspec% /c copy c:\readonly\pjf0600.doc c:\test"' |
||||||||
|
|
|||||||
will do sorry |