New
#1
Run batch file rename a folder as administrator!
I am trying to rename the CBS [C:\Windows\Logs\CBS] folder to CBS_OLD but got an Access Denied error.
I have tried numerous combinations of commands but to no avail and Google has been no help!
Is there an easy way [probably not] to run commands as an Administrator from within a batch file please?
I am not interested in running from the command line or right-clicking and Run as administrator.
This is the latest code I have...
Here is the current output...Code:@echo off echo. net stop wuauserv rem net stop bits takeown /f %systemroot%\Logs\CBS /r /d y ICACLS %systemroot% /grant %username%:F /T rename %systemroot%\Logs\CBS %systemroot%\Logs\CBS_OLD net start wuauserv pause
Thanks in advance.