• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3443
  • Last Modified:

call icacls on powershell script

Hello,

This followin command works in cmd line :

Invoke-Item "icacls.exe c:\test\ /T /C /grant "domain\user:(OI)(CI)F""

but in powershell cmd line :
The term 'OI' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
 of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:71
+ Invoke-Item "icacls.exe c:\test\ /T /C /grant "domain\user:((OI <<<< ))((CI))F""
    + CategoryInfo          : ObjectNotFound: (OI:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

How can I resolve this problem?

Thanks

bibi
0
bibi92
Asked:
bibi92
1 Solution
 
XaelianCommented:
Can you try this in powershell?

icacls c:\test\ /T /C /grant 'domain\user:(OI)(CI)F'
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now