Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I run to command syntax 'cacls d:\dd /t /g everyone:r' for access the network share folder.
But confirmation msg shown to me.

I want to do that, without being asked for confirmation or quiet mode to execute above command syntax.
How will i perform in command prompt???
please anybody help me in right way...
Posted

First of all, CACLS reports itself as deprecated, ICACLS is recommended instead.
Please see: http://technet.microsoft.com/en-us/library/cc753525%28WS.10%29.aspx[^].

If a console application requires a user input, on command line it is simulated using the input pipe "<", such as
someApplication.exe /param1 /param2:value < userinput
In the code of you .NET application, you can do it by redirecting of the input stream System.Diagnostics.Process.StandardInput using System.Diagnostics.Process.Start. You can also redirect StandardOutput and StandardError strings.

Please see the sample code with input redirection: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardinput.aspx[^].

See also http://msdn.microsoft.com/en-us/library/system.marshalbyrefobject.aspx[^].

—SA
 
Share this answer
 
This would have been easy to find. All you had to do was open a CMD prompt and type CACLS /?.

There isn't any mention of anything resembling a Quiet switch or anything to suppress prompts, so no, there's no way to do that.

ICACLS on the other hand, does support it. I'll leave that as an excersize to you to find out what it is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900