Files I create falsely showing as locked by Admin

vbmike73

New member
Local time
6:39 PM
Messages
9
I have many processes that I have created and run through Excel VBA. These processes will save versions of workbooks, or Word files, or PowerPoint files onto my hard drive. Part of these processes is to clear any other files that may have been created the day before.

Here's the problem... randomly when I go to delete some of these files in Windows Explorer, it will tell me I have to have administrator credentials to proceed, even though this is a file that I created on my own hard drive. Other times I can delete them all with no issues. If I reboot, then usually the lock will go away and I can delete the file. Also, I cannot go into the properties and take ownership of it.

Any ideas?
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
That's built in security designed to ensure you want to delete it if it's created by a script it may not be owned by you but system
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
Appreciate your reply, but doesn't make sense to me. Why would it decide to treat one out of 200 files that way? Sometimes I can delete all of the files with no problem, and sometimes one or two will be held this way. What's causing it to treat the file or two differently? They are all being created the exact same way.
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
Thing to do is when you get this is check who owns it that will tell us more
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
Unfortunately I can't see any of this because it is asking for admin credentials. That's the problem. Even Admin is not the owner.
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
That won't stop you viewing the security properties it does suggest it's running as system may a what if in the script then runs as system if it's run by say a AT CMD that will be system
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
ok, but if my script saves let's say 200 files, in a loop, the exact same way, what would cause one of those to be treated differently?
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
Without knowing what's in the script it's hard to say
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
It's strictly just VBA in Excel, making a change in a couple cells, and saving the version off. So using...

ThisWorkbook.SaveAs "C:\filepath"

It flies through a couple hundred files in about 60 seconds. That's why I'm confused how it could treat random files differently.
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
Are they all saved in same folder as a folder permissions could be wrong
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
yes, all in the same folder. All files are exactly the same except for the file name.
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
Only finding the owner gives us a clue to what's happening
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
So it's a dead end I guess since it's impossible to find out the "owner."

Anyways, thanks for trying to help! Much appreciated.
 

My Computer My Computer

At a glance

Windows 7, Windows Vista
OS
Windows 7, Windows Vista
There is nothing stopping you finding the owner you can read the details no matter what
 

My Computer My Computer

At a glance

win 8 32 bit
Computer type
PC/Desktop
OS
win 8 32 bit
Back
Top