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

LuzTeTT

New Member
Messages
21
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:
BRTDE.png
This is new to Windows 8. Why is this happening?
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
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 Computer

System One

  • OS
    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?

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:

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
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 Computer

System One

  • OS
    Windows 8.1 Pro
    CPU
    Intel i7 3770K
    Motherboard
    Gigabyte Z77X-UD4 TH
    Memory
    16GB DDR3 1600
    Graphics Card(s)
    nVidia GTX 650
    Sound Card
    Onboard Audio
    Monitor(s) Displays
    Auria 27" IPS + 2x Samsung 23"
    Screen Resolution
    2560x1440 + 2x 2048x1152
    Hard Drives
    Corsair m4 256GB, 2 WD 2TB drives
    Case
    Antec SOLO II
    Keyboard
    Microsoft Natural Ergonomic Keyboard 4000
    Mouse
    Logitech MX
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 Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
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 Computer

System One

  • OS
    Windows 8.1 Pro
    CPU
    Intel i7 3770K
    Motherboard
    Gigabyte Z77X-UD4 TH
    Memory
    16GB DDR3 1600
    Graphics Card(s)
    nVidia GTX 650
    Sound Card
    Onboard Audio
    Monitor(s) Displays
    Auria 27" IPS + 2x Samsung 23"
    Screen Resolution
    2560x1440 + 2x 2048x1152
    Hard Drives
    Corsair m4 256GB, 2 WD 2TB drives
    Case
    Antec SOLO II
    Keyboard
    Microsoft Natural Ergonomic Keyboard 4000
    Mouse
    Logitech MX
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 Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
And to reiterate. I have no problems doing such. That means whatever the problem is, it's not a Windows 8 problem.
 

My Computer

System One

  • OS
    Windows 8.1 Pro
    CPU
    Intel i7 3770K
    Motherboard
    Gigabyte Z77X-UD4 TH
    Memory
    16GB DDR3 1600
    Graphics Card(s)
    nVidia GTX 650
    Sound Card
    Onboard Audio
    Monitor(s) Displays
    Auria 27" IPS + 2x Samsung 23"
    Screen Resolution
    2560x1440 + 2x 2048x1152
    Hard Drives
    Corsair m4 256GB, 2 WD 2TB drives
    Case
    Antec SOLO II
    Keyboard
    Microsoft Natural Ergonomic Keyboard 4000
    Mouse
    Logitech MX
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.

Elevated Command Prompt.png


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

AdminAccount.png



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 Computer

System One

  • OS
    Win7-8 Dual Boot on a Commodore 64
Thank you for your declarations. I am using a fresh install of Windows 8.

Please read the initial post.
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
You may run into a few difficulties with doing a lot of things on win8.

If you are trying to replace or even place a file into Windows dir - you may need to muck about with the security settings . It is annoying.

MS are not expecting the average user will do that kind of thing. They haven't made it easy.
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop
You may run into a few difficulties with doing a lot of things on win8.

If you are trying to replace or even place a file into Windows dir - you may need to muck about with the security settings . It is annoying.

I had expected as much.

Running an elevated command prompt to launch the batch file manually by relocating to its directory in the following manner
YUa53.png
allows for the file to execute and copy the files smoothly, but if I right click the batch file and 'Run as Administrator', it doesn't do anything at all.

This is very strange behaviour.
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
You will get plenty of strange behaviour.

I am resorting to Helge's setacl more and more to try and beat win8 into submission.

If you try and make yourself decent pe media, you will have a hell of a job.

I ended up replacing some files with those from win7 - MS have made things difficult for those who do more than just jabbing at little squares.
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop
Not done much DOS Batch files for a while, but you may want to have a look at using the RunAs command with the Administrator Username and password within your batch file, and including the full path to the EXE file - it has solved problems for me in the past, and I believe it's still in Win8 implimentation

Could just be a one line batch file to run the EXE
 

My Computer

System One

  • OS
    Windows 10 Pro x64 x2 Windows 10 Enterprise x64, Ubuntu
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Real World Computing
    CPU
    AMD FX8350 8 Core @4GHz
    Motherboard
    Asus M5A78L-M USB3
    Memory
    32GB [4x8GB] DDR3 1600 MHz
    Graphics Card(s)
    Asus nVidia GTX750TI-OC-2GD5 (2GB DDR5)
    Sound Card
    ASUS Xoner DG + SPDIF to 5.1 System + HDMI
    Monitor(s) Displays
    Acer G276HL 27", (DVi) + Samsung 39" HDTV (HDMI)
    Screen Resolution
    1920 x 1080 @60Hz + 1920 x 1080 @60Hz
    Hard Drives
    Internal
    Crucial 256GB SSD,
    WDC WD30EZRX-00D8PB0 3TB,
    Toshiba HDWD130 3TB
    Seagate ST2000DM001-1CH1 2TB,

    External (USB3)
    Seagate Backup+ Hub BK SCSI Disk 8TB
    2.5/3.5 Hot Swap Cradle, USB3 + eSata (client HDDs)

    NAS
    Seagate ST4000DM000
    PSU
    Aerocool Templarius Imperator 750W 80+ Silver
    Case
    AeroCool X-Warrior Devil Red Tower
    Cooling
    Stock CPU, Rear 120mm, Front 2x120mm, Side 2x120mm
    Keyboard
    Logitech Wireless K710 & K270
    Mouse
    Logitech Wireless M710 M185 & M570 Trackball
    Internet Speed
    37Mb/s Down - 9.5Mb/s Up
    Browser
    Chrome
    Antivirus
    BitDefender Total Security 2017
    Other Info
    Also run...

    Desktop - 6Core 8GB - Windows 10 Enterprise x64,
    Laptop - Quad 8GB - Windows 10 Pro x64
    Netbook - Ubuntu
    2 x Nexus 7 Android tablets
    Samsung 10.2" tablet
    Sony Z3 Android Smartphone
    HTC One Android Smartphone
Not done much DOS Batch files for a while, but you may want to have a look at using the RunAs command with the Administrator Username and password within your batch file, and including the full path to the EXE file - it has solved problems for me in the past, and I believe it's still in Win8 implimentation

Could just be a one line batch file to run the EXE

This is not a solution for me as this file is used to automate a process on client computers.
The administrator passwords will not be consistent.

I don't know what you're referring to with EXE files.

Out of curiosity is the file even in c:\windows?

The batch file is written to copy two files in to C:\Windows\, and they weren't copied in when the access was denied.
It doesn't need to be in C:\Windows\.

MS have made things difficult for those who do more than just jabbing at little squares.
:(
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
i just checked permissions on the windows dir on my machine. some new stuff in there....and not much of it has write permissions. i would say start there. as to witch one to change i can't tell you. maybe some one els will know a little more about the new stuff aka all application packages.
 

My Computer

System One

  • OS
    Windows 8
    System Manufacturer/Model
    Asus/k52Jc
    CPU
    i3
    Memory
    8gig ddr3
i just checked permissions on the windows dir on my machine. some new stuff in there....and not much of it has write permissions. i would say start there. as to witch one to change i can't tell you. maybe some one els will know a little more about the new stuff aka all application packages.

My user account is a member of the Administrators group.
It does look like the Administrators group has some special permission setup — there is write permissions, but it's set up as special permissions. Oddly enough, I can't seem to find an instance that would show I shouldn't be able to write in there.
Click on Advanced. You'll see what I mean.
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    PC/Desktop
    CPU
    i7 3820 @ 4.68GHz
    Motherboard
    ASUS Rampage IV Extreme RoG BF3
    Memory
    F3-12800CL9D-8GBXL (32GB)
    Graphics Card(s)
    GTX 480 SLI
    Sound Card
    Auzentech X-Fi HomeTheater HD
    Monitor(s) Displays
    Sony 32V5500
    Screen Resolution
    1920 x 1080
    Hard Drives
    LSI MR9260-4i (RAID10):
    Toshiba DT01ACA300 x 4
    iaStorA:
    OCZ Vertex Enterprise 120GB
    ST3500320AS 500GB
    Intel 520 Series 120GB
    PSU
    OCZ ZX 1250W
    Case
    HAF X
    Cooling
    H80
    Keyboard
    Cyborg V.7
    Mouse
    Razer Lachesis 3.5G 5600dpi
    Internet Speed
    23296kbps ds / 812kbps us ADSL2+
    Browser
    Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:23.0) Gecko/20130415 Firefox/23.0
    Other Info
    AverMedia C127 Game Broadcaster HD
very weird settings, its a little on its head. i would go with temp giving app packages write permissions and see how you go.
 

My Computer

System One

  • OS
    Windows 8
    System Manufacturer/Model
    Asus/k52Jc
    CPU
    i3
    Memory
    8gig ddr3
Back
Top