Shell - Passing a mix of variables & text problem.

Hi All,

This is probably something fairly simple, but i need it quite urgently so i'm going to award 500 points for and quick reply.

As you can see below I have a shell command with a mix of variables and text. The problem is with the last string bit "\Dropbox /T /E /G AUTHENTICATED USER:RC"
as i need the authenticated user bit to be in speech quotation marks too which VB wont accecpt.

Shell ("Xcacls " + path + user + "\dropbox /T /E /G AUTHENTICATED USERS:RC")


I need to VB to accept the following code, or something that will do the same job.

Shell ("Xcacls " + path + user + "\dropbox /T /E /G "AUTEHNTICATED" USERS:RC")

As you can see VB gets confused with what appears to be nested speech quotation marks, however the command will not work without the speech quotation marks around AUTHENTICATED USERS.

I need this ASAP for I would be grateful for some urgent help, hence awarding 500 points.
IS_MonkeyAsked:
Who is Participating?
 
EDDYKTConnect With a Mentor Commented:
think you need to include the users inside the double quote


Shell ("Xcacls " & path & user & "\dropbox /T /E /G ""AUTEHNTICATED USERS"":RC")
0
 
fullcontactCommented:
Would this work?

Shell ("Xcacls " + path + user + """\dropbox /T /E /G AUTHENTICATED USERS:RC""")
0
 
iHadiCommented:
try this
Shell ("Xcacls " + path + user + "\dropbox /T /E /G" & Chr(34) & "AUTHENTICATED" & Chr(34)  & "USERS:RC")
0
 
IS_MonkeyAuthor Commented:
So far EDDYKT is the closest, with his answer expect the AUTHENTICATED USERS bit actually requires 3 double quotes """AUTHENTICATED USERS""" so I will split the points and adward him 250.

Now the last part of the challenege...............

When I use xcacls to change authorities Shell ("xcacls " & path & user & "\dropbox /T /E /G ""AUTEHNTICATED USERS"":RC") it wont work, however when i add authorities at a user level it works fine.

E.G.

Shell ("Xcacls " & path & user & "\dropbox /T /E /G " & user & ":RC")

If need be i will award the points and do this as a seprate question.
0
 
EDDYKTCommented:
may be you want to do that


Shell Environ("comspec") & " /c xcacls " & path & user & "\dropbox /T /E /G ""AUTEHNTICATED USERS"":RC")
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.