Solved Batch File Error 5

May 18, 2011 at 05:06:35
Specs: Windows Vista
I wrote a batch file to run a history scan from a usb drive and save the log file back onto the drive. It worked all last week, but now I am getting an "Error 5:Access denied." message upon starting the batch file. Not sure where to go with this one. Any help would be appreciated.

Here is the code that worked last week:

@echo off
iehv /shtml "c:\urls.html"
move c:\urls.html %drive%
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "urls.html" "urls_%username%_%computername%_%%e-%%f-%%g.html"

See More: Batch File Error 5

Report •

May 18, 2011 at 08:52:54
✔ Best Answer
Windows Vista
iehv /shtml "c:\urls.html"
I imagine it's because you're trying to write to the root of the C: drive on a box with UAC.

How To Ask Questions The Smart Way

Report •

May 18, 2011 at 09:01:00
That was it. I turned off UAC and it started working again. Thanks.

Report •
Related Solutions

Ask Question