any changes to the Program files, Windows directory or any subdirectory from there then you are not alone..
Seems these are "Protected Folders" requiring "Elevated Administrator Privileges" when using NTFS. You could always do
the obligatory right-click and "Run as administrator" or just work off a non-protected directory ie: Systemdrive,
User Appdata, Programdata etc. but sometimes that is not a option. Anyway I had a issue from a earlier
post of mine on here where I was attempting to copy files over and then call a batch file to and from the system32 folder until
I thankfully found this fix over at the Stackoverflow forum allowing to runas administrator from a batch file..
Hope this helps anyone else having this issue in the future..Happy Holidays.

Code: Select all
@echo off
:: Credits: http://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file
:: https://sites.google.com/site/eneerge/scripts/batchgotadmin
:: BatchGotAdmin
:: Bypass UAC and Run your batch as admin..
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
<YOUR BATCH SCRIPT HERE>