kirus22
Goto Top

CACLS Bestätigung - Sind Sie sicher J-N?

Hallo zusammen,

ich habe folgendes Problem mit meiner Batch Datei, und zwar werde ich immer wieder dazu aufgeforder das "J" zur Bestätigung einzugeben obwohl ich es umleite... ?!

Skript:

echo j >%tmp%\j.txt
cacls c:\test /T /G Administrator:f <%tmp%\j.txt

Sind Sie sicher (J/N)?

Hab dazu auch einen guten Text gefunden, nur wie bekomm ich das hin?


Note that the %tmp%\j.txt is just a text file at %tmp%\j.txt that
simply contains a 'j' and then a hard return in it. CACLS asks if you are sure
all the time. The piping of the j.txt will answer yes to that prompt.

Gruß Kirus22

Content-Key: 93328

Url: https://administrator.de/contentid/93328

Printed on: April 23, 2024 at 14:04 o'clock

Mitglied: 60730
60730 Jul 31, 2008 at 13:51:15 (UTC)
Goto Top
Servus,

probiers mal so herum:
echo Y|cacls c:\test /T /G Administrator:f
oder so:
echo J|cacls c:\test /T /G Administrator:f
Gruß
Member: Dynadrate
Dynadrate Jul 31, 2008 at 14:06:20 (UTC)
Goto Top
The CACLS command does not provide a /Y switch to automatically answer 'Y' to the Y/N prompt. However, you can pipe the 'Y' character into the CACLS command using ECHO, use the following syntax:

ECHO Y| CACLS /g <username>:<permission>


http://www.ss64.com/nt/cacls.html
Member: TuXHunt3R
TuXHunt3R Jul 31, 2008 at 16:13:38 (UTC)
Goto Top
Greif zur Xcacls.exe, ein Gratis-Kommandozeilentool von Microsoft. Dort lässt sich die J/N-Frage per Parameter überspringen. Es gibt sogar einen schicken KB-Eintrag dazu:
http://support.microsoft.com/kb/318754/DE