I'm trying to have change permissions for a SQL folder via batch file that can be used on various computers with different versions of MSSQL installed. I'm trying to have various IF statement with SET inside of it based on the version number and will plug that into permission part of the script. I have more IFs to add, but I can't get the first one to work.
Here is the script that I am trying to make work:
set /p "instName=Enter Instance Name: "
set /p "ver=Enter SQL Version: "
if "%ver%"="2014" (
set nnn=12
)
icacls "C:\Program Files\Microsoft SQL Server\MSSQL%nnn%.%instName%" /grant NETWORKSERVICE:(OI)(CI)F /T
The instName part works, just not the IF part.
Note: This is my first post here. If I need to fix something about the post, please let me know. Thanks
Aucun commentaire:
Enregistrer un commentaire