I'm trying to create a script to change the security automatically on our Windows 2000 and XP, but I can't get the echo y | to work. For my case it's "o |" because we use french Windows.


If @ProductType = 'Windows 2000 Professional'
$Windows = 'C:\Winnt'
Else
$Windows = 'C:\Windows'
Endif

? 'Windows = $Windows'
? ''

CD "C:\"
Shell 'echo o|cacls "C:" /T /C /G "Administrateurs":F "System":F "Utilisateurs avec pouvoir":C "Utilisateurs":R'
Shell 'echo o|cacls "C:\Documents and Settings" /T /E /C /G "createur proprietaire":C'

If Exist ($Windows + '\progkill.exe')
? 'Sécurité pour ProgKill'
? ''
Shell 'cacls $Windows\progkill.sys /E /G "Utilisateurs":C'
Shell 'cacls $Windows\progkill.dll /E /G "Utilisateurs":C'
EndIf

If Exist ('C:\Program Files\Cogigraphe')
? 'Sécurité pour Cogigraphe'
? ''
Shell 'echo o|cacls $Windows /T /C /G "Utilisateurs":C'
Shell 'echo o|cacls $Windows\*.* /T /C /P "Utilisateurs":R'
EndIf

If Exist ('C:\Program Files\Tacmi')
? 'Sécurité pour Pixia'
? ''
CD 'C:\Program Files\Tacmi'
Shell 'cacls Pixia /e /p "Utilisateurs":C'
CD 'C:\'
EndIf

If Exist ('C:\program Files\ttw\ttw.dus')
? 'Sécurité pour Tap'Touche Windows'
? ''
Shell 'cacls "C:\program Files\ttw\ttw.dus" /E /G "Utilisateurs":C'
EndIf

If Exist ('C:\Program Files\Hewlett-Packard\HP PrecisionScan\ISTech\PLUGINS11')
? 'Sécurité pour Scanners HP'
? ''
CD 'C:\Program Files\Hewlett-Packard\HP PrecisionScan\ISTech\PLUGINS11'
Shell 'cacls *.* /E /G "utilisateurs":C'
CD 'C:\'
EndIf