Shell - Passing a mix of variables & text problem.

Posted on 2006-05-09
Medium Priority
Last Modified: 2010-05-01
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.
Question by:IS_Monkey

Expert Comment

ID: 16637244
Would this work?

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

Expert Comment

ID: 16637404
try this
Shell ("Xcacls " + path + user + "\dropbox /T /E /G" & Chr(34) & "AUTHENTICATED" & Chr(34)  & "USERS:RC")
LVL 26

Accepted Solution

EDDYKT earned 2000 total points
ID: 16638409
think you need to include the users inside the double quote

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

Author Comment

ID: 16638960
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.


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.
LVL 26

Expert Comment

ID: 16639573
may be you want to do that

Shell Environ("comspec") & " /c xcacls " & path & user & "\dropbox /T /E /G ""AUTEHNTICATED USERS"":RC")

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question