How to substitute a variable
Posted: 10 Mar 2019 13:13
The set variables are not being substituted where they are supposed to. This is my code:
When I run it you will see %MachineName% doesn't get substituted. This is the output of the code above:
I did run this with elevated "Run as Administrator ".
Thanks,
Docfxit
Code: Select all
Set MachineName ="Docfxit"
Set UserName="IISUser"
CD \Program Files\fileacl
FILEACL C:\HostingSpaces\Docfxit /D "%MachineName%\IWAM_%MachineName%":WwAWaWePDO /D "%MachineName%\%UserName%":WwAWaWePDO /S "%MachineName%\ASPNET":RrRaRep /S "CREATOR OWNER":U/RrRaRepWwAWaWePXDDcO/RrRaRepWwAWaWePXDDcO /S "NT AUTHORITY\SYSTEM":RrRaRepWwAWaWePXDDcO /S "BUILTIN\Users":RrRaRepWwAX/RrRaRepX /S "%MachineName%\Administrator":RrRaRepWwAWaWePXDDcO /S "BUILTIN\Administrators":RrRaRepWwAWaWePXDDcO /PROTECT
cmd
Code: Select all
C:\Dnload\Webserver>Set MachineName =Docfxit
C:\Dnload\Webserver>Set UserName=IISUser
C:\Dnload\Webserver>CD \Program Files\fileacl
C:\Program Files\fileacl>FILEACL C:\HostingSpaces\Docfxit /D "\IWAM_":WwAWaWePDO
/D "\IISUser":WwAWaWePDO /S "\ASPNET":RrRaRep /S "CREATOR OWNER":U/RrRaRepWwAWa
WePXDDcO/RrRaRepWwAWaWePXDDcO /S "NT AUTHORITY\SYSTEM":RrRaRepWwAWaWePXDDcO /S "
BUILTIN\Users":RrRaRepWwAX/RrRaRepX /S "\Administrator":RrRaRepWwAWaWePXDDcO /S
"BUILTIN\Administrators":RrRaRepWwAWaWePXDDcO /PROTECT
no SID for trustee \IWAM_
Thanks,
Docfxit