elevated folder permissions internationalization problem

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

elevated folder permissions internationalization problem

#1 Post by Ed Dyreen » 22 Feb 2012 14:27

'
Hi folks,

I need to grant some permissions on a folder, I use

Code: Select all

> "!TMP!\j.TMP" (

   echo.!"!echo.j!"!
   echo.!"!echo.y!"!
)

for %%? in (

   Administrators

) do    < "!TMP!\WorkF.TMP" cacls "!$installPath!" /t /e /c /p "%%~?":F

for %%? in (

   Hoofdgebruikers, Gebruikers, Gasten

) do    < "!TMP!\WorkF.TMP" cacls "!$installPath!" /t /e /c /p "%%~?":R
This obviously won't work in US, any ideas how I could make it international/region free ( maybe some other tool ) :?:

I was also thinking of using the result of the net localgroup command, but it's a bad candidate, as it also display;
back-upoperators, helpservicesGroup etc.. :?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: elevated folder permissions internationalization problem

#2 Post by Ed Dyreen » 22 Feb 2012 15:14

'
Not exactly what I wanted

Code: Select all

> "!TMP!\j.TMP" (

   echo.!"!echo.j!"!
   echo.!"!echo.y!"!
)

set "$c=" &for /f "skip=4 delims=*" %%? in (

   'net localgroup'

) do    set /a $c += 1 &set "?.!$c!=%%?"

set /a $c -= 1 &for /l %%! in (

   1, 1, !$c!

) do   for %%? in (

   "!?.%%~!!"

) do    < "!TMP!\WorkF.TMP" cacls "!$installPath!" /t /e /c /p "%%~?":R

for %%? in (

   Administrators

) do    < "!TMP!\WorkF.TMP" cacls "!$installPath!" /t /e /c /p "%%~?":F

del /f /q "!TMP!\j.TMP"
Will this work in US :?:

Post Reply