Unfortunately, I’m still having trouble.
I guess I didn’t test enough. In any case, I’ve been working on it all weekend without success. I was still getting the System Error 5 Access Denied. Now I’m not, but the last approach I took isn’t working. Please read on.
It’s not the batch file that is causing it. The batch file is running fine. It is the following two lines inside the batch file that cause it:
Things I have tried so far:
-
Taking Ownership of everything in
C:\wamp
, its subdirectories, and files. This is the root directory which contains thewampmysqld.exe
program.
Result: no effect -
Setting folder permission for
c:\bkmdos
, its subdirectories and files, so that userLOCAL SERVICE
has full control. This is the root directory where the batch file resides that is being run by<cfexecute>
.
Result: no effect -
I came across this article Block remote callers who are not local administrators from starting/stopping services from Microsoft Support. I tried both registry changes suggested.
Result: no effect -
I decided that maybe the batch file should be “runas” my user Zy, which is an Administrator. But I’m having trouble getting runas.exe to work with
<cfexecute>
.
The remainder of this post refers to where I am with this last attempt at #4 (using runas).
I ran this code:
There was no System Error 5 Access Denied. However I don’t know if the batch file really ran or not. The xcopy certainly didn’t create the backup directory and didn’t copy anything anywhere.
So I dumped the variables RunasArg and Results.

and got:
The RunasArg looks right to me. But the Results variable is certainly wrong.
I found an article here on this board: Escaping quotes for cfexecute. In it, @justaguy, the OP, was trying to run a third party program using <cfexecute>
and wasn’t getting any data returned as output. Is this related to why I’m not getting anything in the Results variable?
@Zackster repied:
Write out a batch file and execute it is a workaround I’ve used in the past
This worked for the OP. But unfortunately I don’t know what @Zackster meant or what he was getting at.
I’m exhausted. I think the best thing I can do is go to bed! I’ll be back to check for replies after a good night’s sleep and a strong cuppa coffee!