Windows 8 and 8.1 Forums


Batch script -> Access Denied to C:\Windows\

Page 1 of 4 123 ... LastLast
  1. #1



    Junior Member

    Join Date : Aug 2010
    Posts : 21
    Windows 8 Pro x64
    Australia au victoria

    Batch script -> Access Denied to C:\Windows\


    Running the following batch script:
    Code:
    @regedit /s registry.reg
    @copy rundll32.exe C:\Windows\
    @copy shimgvw.dll C:\Windows\
    @echo Done.
    @pause
    I am left with the following:
    Click image for larger version
    This is new to Windows 8. Why is this happening?


      My System SpecsSystem Spec

  2. #2



    Member

    Join Date : Jul 2012
    Posts : 534
    Windows 7, Windows 8 RP


    According to your screenshot you are running command window as a regular user, do you get the same access denied when running it as administrator?
      My System SpecsSystem Spec

  3. #3



    Junior Member

    Join Date : Aug 2010
    Posts : 21
    Windows 8 Pro x64
    Australia au victoria


    Quote Originally Posted by R0bR View Post
    According to your screenshot you are running command window as a regular user, do you get the same access denied when running it as administrator?
    I can't seem to run batch files as Admin. They don't even launch. I tried with a blank one and it didn't even launch.
    UAC is disabled on my system though and my account is an administrator.

    *edit: The batch file mentioned in this thread exhibits this behavior. I am able to run a blank one after all.
    Last edited by LuzTeTT; 28 Oct 2012 at 10:15 PM.
      My System SpecsSystem Spec

  4. #4



    Power User


    Join Date : Jun 2012
    Posts : 1,906
    Windows 8.1 Pro
    USA us minnesota


    When you say UAC is disabled, do you mean you turned the slider down? Because that doesn't actually disable UAC, it just auto-approves all the popups so they happen silently.

    Disabling UAC in Windows 8 will cause a number of problems, particularly with Metro apps.

    What is it exactly you are trying to do?
      My System SpecsSystem Spec

  5. #5



    Junior Member

    Join Date : Aug 2010
    Posts : 21
    Windows 8 Pro x64
    Australia au victoria


    Quote Originally Posted by Mystere View Post
    What is it exactly you are trying to do?
    Just execute the above mentioned batch file.

    No, I have only turned UAC down. I haven't disabled any services or anything.
      My System SpecsSystem Spec

  6. #6



    Power User


    Join Date : Jun 2012
    Posts : 1,906
    Windows 8.1 Pro
    USA us minnesota


    I have no problems executing a batch file by right clicking on it and choosing "Run as Administrator". Batch file

    I created a new text file on my desktop, added a single line "pause" to it, then renamed the extension to .bat (also works with .cmd) and right clicked on it and chose Run as Administrator. Worked fine.
      My System SpecsSystem Spec

  7. #7



    Junior Member

    Join Date : Aug 2010
    Posts : 21
    Windows 8 Pro x64
    Australia au victoria


    To reiterate...

    I am unable to run this specific batch file. When I attempt it, I am left with "Access is denied..." to C:\Windows\.
    If I attempt to run it elevated or under the Administrator credentials, by right clicking it, it doesn't do anything at all.

    The batch script is fairly simple, shown in the first post of this thread.
      My System SpecsSystem Spec

  8. #8



    Power User


    Join Date : Jun 2012
    Posts : 1,906
    Windows 8.1 Pro
    USA us minnesota


    And to reiterate. I have no problems doing such. That means whatever the problem is, it's not a Windows 8 problem.
      My System SpecsSystem Spec

  9. #9



    Member

    Join Date : Jan 2012
    Posts : 128
    Win7-8 Dual Boot on a Commodore 64

    cmd-Administrator


    This batch file is a bit more complex than yours,
    but it ran perfectly on Win 7 and it runs fine in Win 8.


    But again, assure you are running cmd as Administrator.

    Click image for larger version


    Also, your Win 8 Login Account should be set to Administrator.

    Name:  AdminAccount.png
Views: 4449
Size:  20.9 KB



    It just cleans EVERY Event Log file know to man...so be sure you WANT that
    to actually happen before you run it!!!

    @echo off
    FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
    IF (%adminTest%)==(Access) goto noAdmin
    for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
    echo.
    echo Event Logs have been cleared! ^<press any key^>
    goto theEnd
    :do_clear
    echo clearing %1
    wevtutil.exe cl %1
    goto :eof
    :noAdmin
    echo You must run this script as an Administrator!
    echo ^<press any key^>
    :theEnd
    pause>NUL


    I'm gonna make a batch of cookies myself :)

    Cheers
    Windunce
      My System SpecsSystem Spec

  10. #10



    Junior Member

    Join Date : Aug 2010
    Posts : 21
    Windows 8 Pro x64
    Australia au victoria


    Thank you for your declarations. I am using a fresh install of Windows 8.

    Please read the initial post.
      My System SpecsSystem Spec

Page 1 of 4 123 ... LastLast
Batch script -> Access Denied to C:\Windows\
Similar Threads
Thread Forum
Win8 Inheriting Permissions causes ACCESS DENIED with folders. General Support
Access Denied Installation & Setup
Solved Access Denied General Support
Permissions: Access denied BSOD Crashes and Debugging
Solved Access denied General Support

Eight Forums Android App Eight Forums IOS App Follow us on Facebook

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23