kirus22

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

geschlossengelöstFrageBatch, Shell Entwicklung
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
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 93328

Url: https://administrator.de/forum/cacls-bestaetigung-sind-sie-sicher-j-n-93328.html

Ausgedruckt am: 17.07.2025 um 02:07 Uhr

60730
60730 31.07.2008 um 15:51:15 Uhr
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ß
Dynadrate
Dynadrate 31.07.2008 um 16:06:20 Uhr
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>


ss64.com/nt/cacls.html
TuXHunt3R
TuXHunt3R 31.07.2008 um 18:13:38 Uhr
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:
support.microsoft.com/kb/318754/DE