Computing.net: Question & Answers Forum Latest Questions

computing
  • 7
  • 7

I thought I could make a simple, one-line script to add the current user to the local admins group: runas /env /user:administrator “net localgroup administrators /add %USERDOMAIN%\%USERNAME%” …but it doesn’t work when run from a network drive because Administrator doesn’t have the ...

computing
  • 0
  • 0

I have a batch file that requires administrative privileges to perform most of its task for which it has this bit of code to do that. >nul 2>&1 “%SYSTEMROOT%\system32\cacls.exe” “%SYSTEMROOT%\system32\config\system” if ‘%errorlevel%’ NEQ ‘0’ ( echo Requesting administrative privileges… goto UACPrompt