c°h°
Hi all,
I wanna use cacls.exe wich comes with windows in a batch file but i have the prob
that everytime a y/n question pops up.

Is there a way 2 handle this ?

TIA
mrBob
you can't use cacls.exe in a batch script like that (so with the /y thingie)
use xcacls.exe for that (google)
jsn
try

cacls.exe /y
Axl
dude...

a helpfull tip...

lets say u have a command that requires comfirmatin...

hm.mm...lets say: format c:

just use format c: /y

/y for yes /n for no...

hope it helps..


c ya...
c°h°
uh ya thx man 4 the fast answer @MrBob

/y dont works with cacls

Here is a direct link i found, if someone is toooo Lazy tongue.gif

http://www.asr-informatique.com/download/xcacls.exe


cu @ll

PS: great forum over here
batigoooal
An usefull tips for all people who used batch is :

prompt n

With this line in the begin of your batch you remove prompt for some command. Maybe not usefull with calcs.exe but very usefull with another command like xcopy,.....

See ya,
RFlash
c°h° try to use the 'pipe' function... (well I don't know if it works in batch files too):

echo y|cacls ....


RFlash
jacerra
Way to go nice post!
woodpecker_sjtu
+/y..
just like net use * /delete /y
Helloman
Just great infos . Nothing more to say smile.gif
Fractured

http://support.microsoft.com/?kbid=135268

Says:

The CACLS.EXE command line utility does not provide a /Y switch that automatically answers with Y for Yes to the ARE YOU SURE? Y/N prompt. However, you can use the echo command to pipe the character Y as input to the ARE YOU SURE? Y/N prompt when you call Cacls.exe in a batch file.

To programmatically answer with Yes to the ARE YOU SURE? Y/N prompt during batch file execution, use the following command line in your batch file:

echo y| cacls filename /g username:permission
NOTE: Do not type a space between the "y" and the pipe symbol (|), otherwise, Cacls.exe fails to make the permission changes.

In larger batch files, this may produce the following error before continuing to the next line:
The Process tried to write to a nonexistent pipe.
The echo command does not expel its output before the system has a chance to build the pipe to cacls. There are different ways to work around this.

As an alternative, you can create a dummy file with just a "y" in it and use the syntax:

Cacls "F:\Directory" /g "Domain Users":R < yes.txt
Or you can use the xcacls utility which does allow the /y:

xcacls "F:\Directory" /e /g "Domain Users":R /y
GogetaSSJ4
I use this:
echo y>y.txt
Cacls "commands" <y.txt
randalizm
go gettas way works best!
and is handy to place at the beginning of a script, how ever theyre all good! smile.gif
boshcash
the two solutions are nice guys .. instead of getting an exe from outside the server ...
cha0s
works... thx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.