创建一个所有用户都有权写入的目录 [英] Create a dir where all the users have the right to write
问题描述
我如何以编程方式执行以下等效操作:
cacls" C:\Program Files \ test" / T / G所有人:f?
谢谢,
Viv
< blockquote> 2004年6月22日星期二11:21:11 +0200,Viviana Vc< vc ******* @ hotmail.com>
写道:
我如何以编程方式执行以下等效操作:
cacls" C:\Program Files \ test" / T / G大家:f?
我正在试着解决问题的一个小变种。我将从旧版本的InstallShield尝试执行此操作,因此我打算使用
调用InstallShield函数来执行运行外部exe。从
直接赢32,我会尝试ShellExecute(更简单)然后
CreateProcess。
我已经开始了尝试DOS提示。到目前为止,我找不到
a的论据集将消除所有提示。
谢谢,
Viv
-----------------------------------------
要回复我,请从我的电子邮件地址中删除下划线(_)(并注明哪个新闻组和消息)。
Robert E. Zaret,eMVP < br $>
PenFact,Inc。
500 Harrison Ave.,Suite 3R
Boston,MA 02118
www.penfact.com
嗨罗伯特,
我还必须在InstallShield中创建这个目录,所以首先我试图找到InstallShield是否提供了一种方法,但似乎没有,
所以我必须调用外部exe来执行此操作。
您应该知道使用CreateProcess或ShellExecute调用
命令:
cacls" C:\Program Files \ test" / T / G每个人:f
不是一个好主意,因为:
a) - cacls它要求用户输入(你确定吗? / n
b) - 每个人是本地化的,所以它不适用于非英语操作系统!!!
为了解决上述问题我在MSDNL中发现了以下文章:
$ b a)的$ b:如何在批处理文件中使用CACLS.EXE对于b),b / b
:创建DACL - >以编程方式更改
目录的安全性
也许这对你有帮助(我现在正在研究第二篇文章),
Viv
2004年6月23日星期三13:14:00 -0400, r_z_aret@pen_fact.com 写道:
2004年6月22日星期二11:21:11 +0200,Viviana Vc< vc ******* @ hotmail.com>
写道:
我如何以编程方式执行以下等效操作:
cacls" C:\Program Files \ test" / T / G每个人:f?
我只是在解决问题的一个小变种。我将尝试从旧版本的InstallShield中执行此操作,因此我计划调用InstallShield函数来执行运行外部exe。从
直接Win 32,我会尝试ShellExecute(更简单)然后
CreateProcess。
我已经开始尝试DOS提示。到目前为止,我找不到
一组消除所有提示的参数。
谢谢,
Viv
-----------------------------------------
要回复我,请从我的电子邮件地址中删除下划线(_)(并注明哪个新闻组和消息)。
Robert E. Zaret,eMVP
PenFact,Inc。
500 Harrison Ave.,Suite 3R
Boston,MA 02118
www .penfact.com
Viviana Vc新闻:2j ************* @ uni-berlin.de写道:
b) - 每个人是本地化的,所以它不适用于非英语操作系统!!!
不,它没有本地化。至少,不是意大利语版本(这是我有的b $ b);这些是未翻译的:
管理员
管理员
游客
客人
用户
高级用户
每个人
备份操作员
这些翻译:
本地服务
网络服务
....还有可能其他人我现在不记得了。
-
ColdShine
经验是一位很难的老师:她先做测试,这一课
之后。 - Vernon Sanders法律
How can I programatically do the equivalent of the following:
cacls "C:\Program Files\test" /T /G Everyone:f ?
Thanks,
Viv
On Tue, 22 Jun 2004 11:21:11 +0200, Viviana Vc <vc*******@hotmail.com>
wrote:
How can I programatically do the equivalent of the following:
cacls "C:\Program Files\test" /T /G Everyone:f ?
I''m just getting around to a minor variant of the question. I''ll be
trying to do it from an old version of InstallShield, so I plan to
call the InstallShield function to execute run an external exe. From
straight Win 32, I would try ShellExecute (simpler) and then
CreateProcess.
I''ve started by experimenting with a DOS prompt. So far, I can''t find
a set of arguments that will eliminate all prompts.
Thanks,
Viv
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
Hi Robert,
I also have to create this dir from within InstallShield, so first I
tried to find if InstallShield offers a way to do this, but seems not,
so I''ll have to call an external exe to do this.
You should be aware that calling with CreateProcess or ShellExecute the
command:
cacls "C:\Program Files\test" /T /G Everyone:f
is not a good idea because:
a) - cacls it''s asking for the user input ("Are you sure? y/n")
b) - "Everyone" is localized, so it won''t work on a non-english OS !!!
To solve the above problems I found in MSDNL the following articles:
for a): "How to Use CACLS.EXE in a Batch File"
for b): "Creating a DACL" -> for programatically change the security of
the directory
Maybe this helps you also (I''m now investigating the second article),
Viv
On Wed, 23 Jun 2004 13:14:00 -0400, r_z_aret@pen_fact.com wrote :
On Tue, 22 Jun 2004 11:21:11 +0200, Viviana Vc <vc*******@hotmail.com>
wrote:How can I programatically do the equivalent of the following:
cacls "C:\Program Files\test" /T /G Everyone:f ?
I''m just getting around to a minor variant of the question. I''ll be
trying to do it from an old version of InstallShield, so I plan to
call the InstallShield function to execute run an external exe. From
straight Win 32, I would try ShellExecute (simpler) and then
CreateProcess.
I''ve started by experimenting with a DOS prompt. So far, I can''t find
a set of arguments that will eliminate all prompts.
Thanks,
Viv
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com
Viviana Vc in news:2j*************@uni-berlin.de wrote:
b) - "Everyone" is localized, so it won''t work on a non-english OS !!!
No, it''s not localized. At least, not in the Italian version (which is what
I have); these are left untranslated:
Administrator
Administrators
Guest
Guests
Users
Power Users
Everyone
Backup Operators
These are translated:
Local Service
Network Service
.... and possibily others I don''t recall right now.
--
ColdShine
"Experience is a hard teacher: she gives the test first, the lesson
afterwards." - Vernon Sanders law
这篇关于创建一个所有用户都有权写入的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!