Technical Discussion
  >> Windows Issues


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
Pages in this thread: 1 | 2 | (show all)   Print Thread
Standard User Andrue
(knowledge is power) Mon 26-Oct-09 10:45:51
Print Post

My first Windows 7 (maybe Vista) gotcha.


[link to this post]
 
Step 1:Launch an application that has a File\Open function.
Step 2:\File\Open some file in a folder.
Step 3:From Explorer try to delete the folder.

At this point you'll be told that you need to be an administrator but no matter what you do you get Access Denied. That's obvious in hindsight but potentially confusing at the time. A Google search might make you try and take ownership but that will fail with access denied.

Step 4:Close the application or navigate to a different folder.

The folder will be deleted automatically.

It looks to me like Win 7 flags the folder as 'awaiting deletion' and stops you doing anything with it. The problem is that Win 7 messaging leads you down the path of thinking that's an access control issue. If it just pointed out that the folder was 'in limbo' things would be a lot more clear.

Andrue Cope
Brackley, UK

Just because he can smile
Standard User deleted
(deleted) Mon 26-Oct-09 11:16:31
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: Andrue] [link to this post]
 
I've just tried that with Notepad, Word, and Visual Studio 10. In all cases there was no problem in deleting a file that they had open.

It may be application dependent. Is it happening with a particular application on your computer?
Standard User Andrue
(knowledge is power) Mon 26-Oct-09 13:12:23
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: deleted] [link to this post]
 
In reply to a post by AnotherExPipex:
I've just tried that with Notepad, Word, and Visual Studio 10. In all cases there was no problem in deleting a file that they had open.

It may be application dependent. Is it happening with a particular application on your computer?
I only noticed it with one of our own apps during testing but hadn't checked any others.

A little more investigation shows that it's a complex scenario to pin down. If I try to delete the folder containing a file that Notepad has open it fails if the user is an administrator. If the user is not an administrator the folder delete goes through.

I reckon that something our app. is doing causes Windows to prompt to elevate the user to admin when they attempt to delete the folder (it was the same prompt you get when mucking about inside Program Files\ - telling you that admin rights will be required). What I can't replicate is the odd behaviour with the folder being visible but in limbo.

Most curious. I think I need to report that as a bug in our app to prompt a proper investigation. I guess it's something to be aware of when dealing with 'Access Denied' in Win7 and perhaps Vista as well.

Andrue Cope
Brackley, UK

Just because he can smile

Edited by Andrue (Mon 26-Oct-09 13:13:57)


Register (or login) on our website and you will not see this ad.

Standard User deleted
(deleted) Mon 26-Oct-09 13:20:26
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: Andrue] [link to this post]
 
I was slightly surprised that the system allowed me to delete a file that applications had open. Ideally an OS wouldn't let you do this, or would at least warn you. But I am also surprised at the error that you get - it should be more along the lines of "The action can't be completed because the folder or a file in it is open in another program". That's what happens if you open a command prompt, CD to it, and then try to delete it using Windows Explorer.
Standard User Andrue
(knowledge is power) Mon 26-Oct-09 14:16:42
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: deleted] [link to this post]
 
In reply to a post by AnotherExPipex:
I was slightly surprised that the system allowed me to delete a file that applications had open. Ideally an OS wouldn't let you do this, or would at least warn you. But I am also surprised at the error that you get - it should be more along the lines of "The action can't be completed because the folder or a file in it is open in another program". That's what happens if you open a command prompt, CD to it, and then try to delete it using Windows Explorer.
Yup, also what I get with Notepad as long as the user doing the opening is an administrator. Prior to trying to delete the folder I had copied it from another machine which might have a bearing on it - although the sequence is getting farcical now smile

From memory it would be:
1.Create a folder on a remote machine (B) from machine (A).
2.Copy a file into that folder from machine (A).
3.Copy that folder onto machine (C) using machine (C).
4.Launch application on machine (C) and leave the about box showing the path. Should mean that the file is not open since it's a requirement to allow users to change it while the app is running.
5.Realise that it's the wrong file so attempt to delete the folder on machine (C) from machine (C).
6.Get confused and annoyed smile

It probably doesn't help that machine (A) is running XP and is a member of our corporate domain. Machine (B) is a domain controller for one of my test domains and is running Win2k3. Machine (C) is a Win7 machine that is a member of the test domain.

So maybe the fact that the folder originally came across the network has a bearing on this?

Andrue Cope
Brackley, UK

Just because he can smile

Edited by Andrue (Mon 26-Oct-09 14:18:59)

Standard User XRaySpeX
(experienced) Mon 26-Oct-09 16:01:51
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: deleted] [link to this post]
 
In reply to a post by AnotherExPipex:
In all cases there was no problem in deleting a file that they had open.
OP said try to delete the folder, not the file!

1999: Freeserve 48K Dial-Up => 2005: Wanadoo 1 Meg BB => 2007: Orange 2 Meg BB => 2008: Orange 8 Meg BB
Standard User Kenneth
(legend) Mon 26-Oct-09 16:09:31
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: Andrue] [link to this post]
 
you get the similar things happen in Vista - this morning I saw it when trying to rename a dir where an Adobe Lightroom cataloge was open - it came up with an error message about needing to give permissions to rename the folder, then brought up UAC dialog, then failed to rename

I can replicate similar if open a handle to a file using createfile - then try to rename the folder with the file in you get "you need to confirm this action" on vista

Ken

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein (1879 - 1955)
Standard User deleted
(deleted) Mon 26-Oct-09 16:41:08
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: Andrue] [link to this post]
 
Had a similar problem in Vista with it not deleting a file then when reattempting it saying it wasn't there only when I navigated to another folder would it go, don't remember a file having been open at the time, I put it down to a slow laptop?

It was a while ago so I may have got the error message wrong.
Standard User deleted
(deleted) Mon 26-Oct-09 16:47:05
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: XRaySpeX] [link to this post]
 
My mistake! Tried the same but deleting the folder. Again deleted without a problem.
Standard User Kenneth
(legend) Mon 26-Oct-09 19:04:06
Print Post

Re: My first Windows 7 (maybe Vista) gotcha.


[re: deleted] [link to this post]
 
I believe notepad reads the whole file and then closes the handles, Visual Studio is similar for most files (not sure about the project files though) - however the likes of Excel and Word maintain a lock on the file denying any other application the ability to modify them

Ken

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein (1879 - 1955)
Pages in this thread: 1 | 2 | (show all)   Print Thread

Jump to