Good morning.
I am having an issue with a batch script I have. I have a program that feeds it a variable and I use that variable to create a folder and then apply Icalcs permissions on it. For some reason it will create the folder with the variable name but Icalcs will be blank where the variable should be. Here is the code -
set whodo=%2
set username=%whodo%
set path="\\example\shares\Student\%username%"
md %path%
md %path%\Desktop
md %path%\Contacts
md %path%\Favorites
md %path%\Links
md %path%\Music
md %path%\Pictures
md %path%\Saved Games
md %path%\Searches
md %path%\Video
md %path%\Documents
c:\windows\system32\icacls.exe %path% /T /C /inheritance:e /grant:r %username%:(OI)(CI)M
The %2 is pulling the variable from the program that runs this script, I was then putting the variable into another variable to see if that would make Icacls happy, but it doesn't. Without the variable pulled from the program this script works fine. I cannot figure out why the Path and Username variables work everywhere but Icacls. Is this some flaw icacls has?
Thanks